Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKosta <konstantin.baumann@autodesk.com>2014-09-04 17:51:09 +0400
committerKosta <konstantin.baumann@autodesk.com>2014-09-04 17:51:09 +0400
commit8b2faff9818aca4be10589d31088ea1c1bae3bb2 (patch)
tree266e562e3b11d4cf2b08edba1d58ecb047e063d3
parentc8da4d86fc691429dd42bfbf2db27e67d06c4d3f (diff)
enhance `IterativeParsingReaderHandler` to check for `Key()` events
-rw-r--r--test/unittest/readertest.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp
index 4c3011ca..d7c8edba 100644
--- a/test/unittest/readertest.cpp
+++ b/test/unittest/readertest.cpp
@@ -819,9 +819,10 @@ struct IterativeParsingReaderHandler {
const static int LOG_DOUBLE = -7;
const static int LOG_STRING = -8;
const static int LOG_STARTOBJECT = -9;
- const static int LOG_ENDOBJECT = -10;
- const static int LOG_STARTARRAY = -11;
- const static int LOG_ENDARRAY = -12;
+ const static int LOG_KEY = -10;
+ const static int LOG_ENDOBJECT = -11;
+ const static int LOG_STARTARRAY = -12;
+ const static int LOG_ENDARRAY = -13;
const static size_t LogCapacity = 256;
int Logs[LogCapacity];
@@ -848,7 +849,7 @@ struct IterativeParsingReaderHandler {
bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }
- bool Key (const Ch* str, SizeType len, bool copy) { return String(str, len, copy); }
+ bool Key (const Ch* str, SizeType len, bool copy) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_KEY; return true; }
bool EndObject(SizeType c) {
RAPIDJSON_ASSERT(LogCount < LogCapacity);
@@ -882,7 +883,7 @@ TEST(Reader, IterativeParsing_General) {
handler.LOG_STARTARRAY,
handler.LOG_INT,
handler.LOG_STARTOBJECT,
- handler.LOG_STRING,
+ handler.LOG_KEY,
handler.LOG_STARTARRAY,
handler.LOG_INT,
handler.LOG_INT,
@@ -920,7 +921,7 @@ TEST(Reader, IterativeParsing_Count) {
handler.LOG_STARTOBJECT,
handler.LOG_ENDOBJECT, 0,
handler.LOG_STARTOBJECT,
- handler.LOG_STRING,
+ handler.LOG_KEY,
handler.LOG_INT,
handler.LOG_ENDOBJECT, 1,
handler.LOG_STARTARRAY,