Steve Hanson
7cad78e236
tidy up after merge from master
2022-12-01 00:42:44 +08:00
Tom Briden
1f59c69cd1
valuetest: fix potential write of terminating nul past the end of the destination
...
Fixes 2 compile errors with gcc-12, eg:
tesunittest/valuetest.cpp:1516:30: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
test/unittest/valuetest.cpp:1516:20: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
2022-05-16 10:23:11 +08:00
ylavic
117276c413
Fix would-crash tests if the default allocator used were kNeedFree.
...
The allocator cannot be destroyed before the Document, otherwise the
Value destructor double frees.
2021-04-02 21:09:20 +02:00
ylavic
50cb424c34
Test assignment from inner Value.
2021-03-15 23:57:42 +01:00
Silas S. Brown
b7734d97c0
Remove unnecessary wording from BSD license not needed for MIT license ( fixes #528 )
2020-10-09 10:04:27 +01:00
Minmin Gong
ff76343336
Update the code to adapt the new gtest.
2018-07-16 20:36:20 -07:00
MaximeBF
27424d5c09
Change long/ulong as int/uint on MSC unit tests to be more inline with other templated functions unit tests
2018-03-14 08:44:00 -04:00
MaximeBF
a37f9d1ecd
Fix unsigned long as unsigned unit test
2018-03-08 07:33:26 -05:00
MaximeBF
a040fc3347
Add unittest for long as int in MSC platforms
2018-03-08 07:28:51 -05:00
Philipp A. Hartmann
47c3c1ec9f
Improved handling of NULL strings
...
* Safely assert upon passing NULL string without length
(requires usage of RAPIDJSON_ASSERT within an expression)
* Allow using a NULL string together with an explicit length 0
(GenericStringRef, GenericValue::SetString, ...), see #817
* Add GenericValue::SetString(StringRefType, Allocator&) overload
* Add tests for the various cases
2017-07-09 14:46:59 +02:00
Eli Fidler
c52cec7e51
fix undefined double to uint64_t cast
...
note that std::numeric_limits<uint64_t>::max() and
std::numeric_limits<int64_t>::max() aren't exactly representable in a
double, so we need to be strictly less to be definitely lossless
UBSAN gave during Value.IsLosslessDouble test:
include/rapidjson/document.h:955:42: runtime error: value 1.84467e+19 is outside the range of representable values of type 'unsigned long'
2016-06-14 07:01:41 -07:00
Eli Fidler
760ea4316c
avoid signed-integer underflow, which is undefined behavior
...
maybe these tests should just be deleted?
UBSAN gave:
runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long'
runtime error: signed integer overflow: -9223372036854775808 - 2 cannot be represented in type 'long'
2016-06-14 07:01:41 -07:00
Eli Fidler
5c77c9248c
with recent clang, this triggers -Wunevaluated-expression
...
specifically, "expression with side effects has no effect in an unevaluated context"
2016-06-13 07:24:26 -07:00
Milo Yip
c71825f80e
Improve Value::IsFloat() coverage
2016-04-16 22:14:38 +08:00
Milo Yip
c843a2655b
Try to fix all /W4 warnings in VC2015
2016-04-04 15:01:34 +08:00
Milo Yip
01b2d463f7
Fix #573
2016-03-05 10:34:00 +08:00
Milo Yip
d9cf99baf6
Normalize all line endings
2016-03-04 09:44:01 +08:00
Sergey Kosarevsky
1ffb335915
Added RawNumber() to fix unit tests
2016-02-29 18:05:05 +01:00
Milo Yip
770f3a47b1
Bypass a VC2010 problem on IsLosslessDouble()
2016-02-21 14:57:08 +08:00
Milo Yip
4620fa60f5
Fix VS2010 compilation errors
2016-02-21 12:52:14 +08:00
Milo Yip
b8c83c53b1
Resolve conflicts
2016-02-19 23:40:48 +08:00
Milo Yip
46dc8e9240
Add implicit constructors of GenericValue for GenercArray|Object
...
Also remove SetArray|Object(…)
2016-02-19 00:49:05 +08:00
Milo Yip
d13be6c721
Change pointer to reference in GenericArray|Object
2016-02-18 19:04:22 +08:00
Milo Yip
e731726c56
Optimize memory consumption with RAPIDJSON_48BITPOINTER_OPTIMIZATION
...
#330
2016-02-15 11:20:00 +08:00
Milo Yip
1634395378
Add object helper
2016-02-14 13:49:52 +08:00
Milo Yip
960324a95b
Try to fix gcc compilation error
2016-02-13 23:07:26 +08:00
Milo Yip
2a78b4da8c
Fix Value.String test compilation error
2016-02-13 22:11:12 +08:00
Milo Yip
0b098eb38d
Rectify constness of Array
2016-02-13 22:09:14 +08:00
Milo Yip
59309b5dd2
Add GenericArray helper class with range-based for
2016-02-13 19:06:03 +08:00
Milo Yip
513fe7894e
Add templated accessors for C string
2016-02-12 23:06:49 +08:00
Milo Yip
4d648fdcd8
Add templated accessors
2016-02-12 18:23:32 +08:00
Milo Yip
8b4c999888
Add Value::GetFloat(), Value::IsLossLessFloat/Double()
...
Fix #341
2016-02-12 16:33:31 +08:00
Milo Yip
c828037784
Make a stackoverflow solution
2016-02-06 16:55:15 +08:00
Milo Yip
d8c793f23f
Disable type_traits
2016-01-23 15:27:59 +08:00
Milo Yip
a6eb15d274
Fix warnings in clang for C++11
2016-01-23 14:37:15 +08:00
Milo Yip
c6384da755
Try to fix clang and gcc warnings problems again x11
2015-12-18 20:53:07 +08:00
Milo Yip
6d6381f596
Try to fix clang and gcc warnings problems again x7
2015-12-18 20:15:11 +08:00
Milo Yip
d72039f3ef
Try to fix clang and gcc warnings problems again x6
2015-12-18 20:06:58 +08:00
Milo Yip
d6478991d0
Try to fix clang and gcc warnings problems again x4
2015-12-18 19:54:10 +08:00
Milo Yip
74c8dcfd57
Fix clang -Weverything
2015-12-18 18:34:04 +08:00
Philipp A. Hartmann
46e1696316
add free inline swap
functions
2015-07-13 09:35:15 +02:00
miloyip
6e1d10ec6b
Add GenericValue::EraseMember(string types) APIs
2015-05-21 16:12:33 +08:00
miloyip
2786103abd
Add Value::XXXMember(...) overloads for std::string
2015-05-12 22:48:14 +08:00
miloyip
8d39282af5
Update license headers for tests
2015-04-18 21:41:38 +08:00
miloyip
933c4a6cb1
Improve Value deep-clone coverage
2015-04-13 23:12:57 +08:00
miloyip
59ffb9e5f0
Try to fix a gcc/clang error
2015-04-13 18:32:11 +08:00
miloyip
d439f989bf
Add valuetest coverage
2015-04-13 18:10:07 +08:00
Milo Yip
d7ad55f49e
Another two warnings
2015-04-11 00:20:10 +08:00
Milo Yip
09448e980b
Another warning in valuetest
2015-04-11 00:12:15 +08:00
Milo Yip
2452afbf3c
Fix -Wfloat-equal warnings in Value::operator== and valuetest
2015-04-11 00:02:17 +08:00