604 Commits

Author SHA1 Message Date
Milo Yip
56b7216efe Fix #949 about -Werror=conversion 2017-05-12 10:32:41 +08:00
Alejandro Martinez
2291258bb8 Added ARM-Neon support for SIMD.SkipWhitespace*
Change-Id: Iaf210d029758723a7eeb7f28fc10cab7467889a9
Signed-off-by: Jun He <jun.he@arm.com>
2017-04-21 07:33:17 +00:00
Milo Yip
5d9d0f78b5 Merge pull request #909 from miloyip/issue905_PrettyWriterWriteFlags
Fix #905 unable to set writeFlags for PrettyWriter
2017-03-27 18:26:17 +08:00
Milo Yip
d88be8ef16 Fix #905 unable to set writeFlags for PrettyWriter 2017-03-27 14:05:03 +08:00
Alejandro Martinez
85500e8c8f Changed error code for invalid special ascii chars, fixed writer tests 2017-03-24 13:37:23 +00:00
Alejandro Martinez
3c6e2cf030 Added unittests for invalid ascii control chars 2017-03-23 10:14:17 +00:00
Milo Yip
465fab45c1 Merge pull request #897 from StilesCrisis/issue-889-pretty-writer
Issue 889 pretty writer
2017-03-16 10:35:26 +08:00
John Stiles
d5d18cf694 Fix template length optimization issue in PrettyWriter
Missed PrettyWriter in the initial fix for Issue #889
2017-03-14 23:48:41 -07:00
John Stiles
84a0356608 Add unit test for Issue 889 2017-03-12 23:40:54 -07:00
John Stiles
66b564f385 Remove unneeded change 2017-03-03 00:42:21 -08:00
John Stiles
6ae50ad6e3 Once again 2017-03-03 00:27:47 -08:00
John Stiles
534f135261 Try again to suppress Valgrind 2017-03-03 00:21:10 -08:00
John Stiles
13e99d8d5f Trivial change to re-trigger Travis CI
No-op blank line
2017-02-28 22:58:24 -08:00
John Stiles
4b822a41af Attempt to suppress valgrind wcslen error 2017-02-28 19:31:21 -08:00
Milo Yip
e6b192a75c Merge pull request #869 from StilesCrisis/writer-key-fix
Writer EndObject missing-value fix
2017-02-28 16:02:52 +08:00
StilesCrisis
0ec4e86f14 Unit test
Add unit test for Issue 848 (segfault in ~Document)
2017-02-27 23:06:05 -08:00
StilesCrisis
fa84cd18f4 Add matching fix for PrettyWriter
PrettyWriter EndObject will now also assert if called when a key is
missing its matching value.
2017-02-27 22:53:59 -08:00
StilesCrisis
595b114216 Unit test
Add unit tests expecting an assertion when writing an object with a key
but no value.
2017-02-27 22:36:48 -08:00
StilesCrisis
ecf3d64293 Merge branch 'nan-inf-parse-fix' into token-by-token-parsing 2017-02-23 00:19:07 -08:00
StilesCrisis
5e785d3db2 Fix parsing of NaN/Inf
A failed half-consume of “NaN” now returns “value invalid” instead of
attempting to consume an “Inf”.
2017-02-23 00:11:12 -08:00
StilesCrisis
c4117c68cc Put in unit tests to catch parser failure
Noticed that the reader could over-consume “NaN” if token terminated in
the middle.
2017-02-22 21:54:31 -08:00
John Stiles
bd4c282d77 Test coverage up
Add more tests! Good for coverage.
2017-02-07 01:08:51 -08:00
John Stiles
488252eca2 Merge remote-tracking branch 'miloyip/master' into token-by-token-parsing 2017-02-06 21:12:52 -08:00
StilesCrisis
82a423db7d Added unit test for pull parsing
New unit test which ensures that IterativeParseNext always generates
exactly one element at a time, and that calling IterativeParseNext on a
complete document is harmless and generates zero events.
2017-02-03 21:12:53 -08:00
StilesCrisis
6769f3e33e Improved reporting
Add “filename” to the error message when JsonChecker reports an error.
2017-02-02 23:18:07 -08:00
Milo Yip
738864c53c Remove non-ASCII character
Fix #824
2017-01-24 15:08:38 +08:00
Zhihao Yuan
3cc77d5d63
Treat signed-unsigned conversions as errors. 2017-01-18 18:09:18 -06:00
Andrey Glebov
41ceb8624f - replaced RAPIDJSON_NEW with C++98 compatible version 2016-12-21 14:03:53 +03:00
Andrey Glebov
3f120caeef - replaced RAPIDJSON_NEW calls in fwdtest.cpp 2016-12-21 10:41:06 +03:00
Milo Yip
517dd4dbb8 Fix failing to resolve $ref in allOf causes crash in SchemaValidator::StartObject() 2016-10-17 14:25:24 +08:00
Milo Yip
3f23397596 Remove unncessary std::move()
Fixes #762
2016-10-05 15:02:31 +08:00
Milo Yip
5cd62c235d Add StringBuffer::GetLength()
Fix #744
2016-09-22 18:11:22 +08:00
Milo Yip
0761ac126b Remove lambda expression in (pretty)writertest 2016-09-21 21:49:49 +08:00
Tallódi Mihály
1a64cd0997 Tests for Writer, PrettyWriter move constructors 2016-09-19 22:13:33 +02:00
Milo Yip
769185d68b Refactor regex
Remove mutable which causes reentrant issue
2016-09-16 12:13:02 +08:00
niukuo
250cf666d3 fix wrong length in remote schema
Change-Id: Ia96ddf5746f1c18968e9e086f17fe4a24b8480d7
2016-08-31 16:26:27 +08:00
Jason Smith
252e8122bf Fix buffer overrun using PutN (closes #672)
Fix inconsistent calling of template functions in PutN in stream.h. When
used with a GenericStringBuffer<<UTF8>, MemoryPoolAllocator>, PutN would call
PutReserve from stream.h, and PutUnsafe from stringbuffer.h. This
resulted in bytes being added to the buffer without allocating space.

This was not an issue when used with the default memory allocator,
because in this case the specialized PutN is used from stringbuffer.h.
2016-06-30 14:18:14 -07:00
Philipp A. Hartmann
ad32940da8 readertest: Suppress "dangling-else" warning on GCC 7 and later
GCC 6.x doesn't yet support this warning flag, as reported by
@ragnar-ouchterlony.
2016-06-27 19:05:29 +02:00
Philipp A. Hartmann
f6a07692f9 Fix warnings on GCC 6 and later (closes #666)
* document.h
  * suppress -Wterminate on GCC 6.x and later
  * simplify warning handling
* schema.h
  * drop RAPIDJSON_NOEXCEPT from GenericSchemaDocument constructor
    (calls RAPIDJSON_NEW anyway)
  * simplify warning handling
    (avoids RAPIDJSON_POP mismatch on Clang)
* encodingtest.cpp, istreamwrappertest.cpp
  * work around -Wdangling-else
* readertest.cpp
  * suppress -Wdangling-else
2016-06-23 21:42:16 +02:00
Eli Fidler
8c4059766e test for no-double-promotion instead of just checking compiler version 2016-06-14 07:01:41 -07: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
df9b45a656 avoid division by zero, which is undefined behavior
UBSAN gave:
runtime error: division by zero
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
be1eedf808 avoid signed-integer overflow, which is undefined behavior
UBSAN gave for test/unittest/itoatest.cpp:87:
runtime error: signed integer overflow: 4611686018427387904 * 2 cannot be represented in type 'long'
2016-06-14 07:01:41 -07:00
Eli Fidler
fe550f3866 avoid array index out-of-bounds
UBSAN gave "runtime error: index 13 out of bounds for type 'const uint32_t [10]'"
2016-06-13 07:24:26 -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
Eli Fidler
035271091f with recent clang, when expected is false, this code triggers -Wunreachable-code
clang advises: "note: silence by adding parentheses to mark code as explicitly dead"
2016-06-13 07:24:26 -07:00
Eli Fidler
13e3aa9b00 we do need to avoid the double-promotion warning on clang, since we're compiling with -Werror 2016-06-13 07:24:26 -07:00
Michael Thon
135da7ab34 Allow options for writing and parsing NaN/Infinity
This adds kWriteNanAndInfFlag to Writer to allow writing of nan,
inf and -inf doubles as "NaN", "Infinity" and "-Infinity",
respectively, and kParseNanAndInfFlag to Reader to allow parsing
of "NaN", "Inf", "Infinity", "-Inf" and "-Infinity". This is part
of issue #36, adding optional support for relaxed JSON syntax.
2016-05-20 23:54:55 +02:00
Milo Yip
c8a1d51753 Add reproduction test case 2016-04-19 15:05:15 +08:00