65 Commits

Author SHA1 Message Date
Milo Yip
fa52a26909 Fix a unit test warning and suppress a failing case 2014-09-14 12:52:07 +08:00
Milo Yip
98dd0a0a64 Make custom strtod work for denormal numbers and some boundary cases [ci skip] 2014-09-13 23:24:40 +08:00
Milo Yip
4bd240abee Implementing custom strtod, fail on some cases [ci skip] 2014-09-12 23:03:20 +08:00
Milo Yip
359ebc78c0 Extract conversion code to strtod.h [ci skip] 2014-09-10 23:36:09 +08:00
miloyip
774a4aa2b2 Fix VC2010 which don't have std::isnan() et al. 2014-09-10 09:28:52 +08:00
miloyip
add0d9c8f9 Compute error statistics of normal precision 2014-09-05 22:18:40 +08:00
miloyip
c4a657d430 Fix ParseNumber_Integer test 2014-09-05 20:06:03 +08:00
miloyip
a71f2e60ff Optimize ParseNumber() 2014-09-05 19:51:20 +08:00
Milo Yip
881c91d696 Merge master and implement kParseFullPrecision 2014-09-05 13:22:56 +08:00
Kosta
25f4892aa1 removed unused argument names 2014-09-04 15:56:21 +02:00
Kosta
8b2faff981 enhance IterativeParsingReaderHandler to check for Key() events 2014-09-04 15:51:09 +02:00
Kosta
23b3d24355 add Key() to IterativeParsingReaderHandler in readertest.cpp` 2014-09-04 15:24:52 +02:00
miloyip
b0436911a8 Check "fast path cases in disguise" in strtod 2014-09-03 14:45:37 +08:00
miloyip
818f6f1f2e Add random tests for ParseNumber 2014-09-03 13:27:43 +08:00
miloyip
0580d42d11 Fallback strtod() when not able to do fast-path
This shall generate best possible precision (if strtod() is correctly
implemented). Need more unit tests and performance tests. May add an
option for accepting precision error. Otherwise LUT in Pow10() can be
reduced.
2014-09-03 01:02:38 +08:00
miloyip
d8a51bf2a1 Add test case 2014-08-28 23:03:06 +08:00
Philipp A. Hartmann
6863033652 readertest.cpp: remove remaining use of private functions 2014-08-11 17:27:38 +02:00
Philipp A. Hartmann
453eda5f94 tabs to 4 spaces (following 0dbcc1cf) 2014-08-11 17:22:11 +02:00
Philipp A. Hartmann
834109557d readertest.cpp: use CRTP to activate "ADD_FAILURE()" calls in handlers 2014-08-11 17:15:07 +02:00
Philipp A. Hartmann
e29a4521b1 readertest.cpp: use top-level Parse functions, instead of internal ones
With the allowance of arbitrary root value types, the individual tests
can use the top-level Parse functions, instead of ParseFoo() variants.

Secondly, some unneeded array wrappers have been dropped and non-singular
tests starting with other values than objects or arrays have been added.
2014-08-11 17:14:31 +02:00
Philipp A. Hartmann
c256752668 readertest: drop object/array root restriction tests 2014-08-11 17:14:31 +02:00
Milo Yip
0dbcc1cf2e Add license and change indents from tab to space. 2014-08-11 22:26:45 +08:00
Milo Yip
5456606232 Add a "must underflow" case as suggested by @pah 2014-07-31 00:02:02 +08:00
Milo Yip
808d362b88 Fix parsing numbers which are less than 1e-308
Overflow should check sign of exponent.
2014-07-30 23:27:17 +08:00
miloyip
fdd380bbc0 Added insitu parsing test for kParseStopWhenDoneFlag
Related to discussion in #83
2014-07-29 13:01:35 +08:00
Milo Yip
3d106085c1 Add a space in multiple root test for ensuring that whitespace is not consumed when done. 2014-07-27 17:29:03 +08:00
Milo Yip
c81386413b Add kParseStopWhenDoneFlag, its implementation and related unit tests 2014-07-27 17:10:32 +08:00
thebusytypist
140dc0664e Fix compilation error(signed/unsigned comparison). 2014-07-18 01:08:07 +08:00
thebusytypist
afa59455a5 Fix compilation error(unused variable, signed/unsigned comparison). 2014-07-18 00:36:31 +08:00
thebusytypist
c3d7d8b38a Revise unittests: should not expose implementation details. 2014-07-16 23:10:16 +08:00
thebusytypist
1f53c6c041 Implement stack size limitation for iterative parsing. 2014-07-15 14:16:06 +08:00
thebusytypist
46e89dad0d Add unittests for kParserErrorTermination; Fix bugs in last merge. 2014-07-15 00:51:34 +08:00
thebusytypist
d4da07c5fb Merge upstream/master. 2014-07-14 23:49:57 +08:00
thebusytypist
face7240fe Revise unittests of compound value(array or object)'s initial state transition. 2014-07-11 16:33:32 +08:00
thebusytypist
3038a7855e Revise unittests: reset the handler before the transition which we are going to test. 2014-07-11 16:03:38 +08:00
thebusytypist
36434b66c8 Merge remote-tracking branch 'upstream/master' into TransitionTable 2014-07-11 12:52:07 +08:00
thebusytypist
70d01cc5f3 Complete unittests for state transition. 2014-07-11 11:43:09 +08:00
Milo Yip
f1ae39f9e2 Fixed readertest compilation error 2014-07-11 00:37:55 +08:00
thebusytypist
e3c4b33915 Add unittests for state transition. 2014-07-10 22:27:25 +08:00
Milo Yip
cc04219e36 Fixes #59 by adding bool return value for each event handler function 2014-07-10 19:33:01 +08:00
thebusytypist
f6235b2160 Add basic error handling. 2014-07-10 00:00:56 +08:00
Philipp A. Hartmann
813da24d72 Add RAPIDJSON_DIAG_* macros to handle compiler warnings
Warning push/pop support has been added to GCC in version 4.6.0,
and pragmas to ignore certain warnings are present since 4.2.0.
This patch hides the compiler-specific warning push/pop/disable
pragmas behind a macro-based implementation (currently for MSVC and
clang /GCC.

This avoids warnings, as seen e.g. on GCC 4.4:
  ../../include/rapidjson/document.h:14: error: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
and earlier versions complaining about unknown pragmas being ignored.

Note: unittest.h and perftest.h need to check for compilers
explicitly, as rapidjson.h is not included there.
2014-07-08 14:45:19 +02:00
thebusytypist
6b0df217a8 WIP: refactor iterative parsing. 2014-07-08 02:19:35 +08:00
thebusytypist
7d33b01515 Bugfix: add missing transition from finish state. 2014-07-07 21:57:23 +08:00
thebusytypist
7acb0c181e Rename flags/state names/functions/test cases from 'NonRecursive' to 'Iterative'. 2014-07-07 21:46:57 +08:00
thebusytypist
3006fa7d8c Try to resolve issue #35: implement iterative parsing. 2014-07-06 21:15:38 +08:00
Milo Yip
0bff4ffd0c Adds unit tests about streams. 2014-07-04 16:39:09 +08:00
Philipp A. Hartmann
6b7f346437 ParseErrorCode: fix typo (NumberTooBig) 2014-07-03 17:06:35 +02:00
Milo Yip
1e99f0b537 Merge remote-tracking branch 'origin/master' into warning 2014-07-03 01:00:01 +08:00
Milo Yip
5a186104f4 Fixes warnings 2014-07-03 00:59:35 +08:00