Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
1ffb3359
Commit
1ffb3359
authored
Feb 29, 2016
by
Sergey Kosarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added RawNumber() to fix unit tests
parent
3dba3704
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
25 deletions
+29
-25
readertest.cpp
test/unittest/readertest.cpp
+16
-14
valuetest.cpp
test/unittest/valuetest.cpp
+13
-11
No files found.
test/unittest/readertest.cpp
View file @
1ffb3359
...
...
@@ -1351,12 +1351,13 @@ struct TerminateHandler {
bool
Int64
(
int64_t
)
{
return
e
!=
4
;
}
bool
Uint64
(
uint64_t
)
{
return
e
!=
5
;
}
bool
Double
(
double
)
{
return
e
!=
6
;
}
bool
String
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
7
;
}
bool
StartObject
()
{
return
e
!=
8
;
}
bool
Key
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
9
;
}
bool
EndObject
(
SizeType
)
{
return
e
!=
10
;
}
bool
StartArray
()
{
return
e
!=
11
;
}
bool
EndArray
(
SizeType
)
{
return
e
!=
12
;
}
bool
RawNumber
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
7
;
}
bool
String
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
8
;
}
bool
StartObject
()
{
return
e
!=
9
;
}
bool
Key
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
10
;
}
bool
EndObject
(
SizeType
)
{
return
e
!=
11
;
}
bool
StartArray
()
{
return
e
!=
12
;
}
bool
EndArray
(
SizeType
)
{
return
e
!=
13
;
}
};
#define TEST_TERMINATION(e, json)\
...
...
@@ -1377,14 +1378,15 @@ TEST(Reader, ParseTerminationByHandler) {
TEST_TERMINATION
(
4
,
"[-1234567890123456789"
);
TEST_TERMINATION
(
5
,
"[1234567890123456789"
);
TEST_TERMINATION
(
6
,
"[0.5]"
);
TEST_TERMINATION
(
7
,
"[
\"
a
\"
"
);
TEST_TERMINATION
(
8
,
"[{"
);
TEST_TERMINATION
(
9
,
"[{
\"
a
\"
"
);
TEST_TERMINATION
(
10
,
"[{}"
);
TEST_TERMINATION
(
10
,
"[{
\"
a
\"
:1}"
);
// non-empty object
TEST_TERMINATION
(
11
,
"{
\"
a
\"
:["
);
TEST_TERMINATION
(
12
,
"{
\"
a
\"
:[]"
);
TEST_TERMINATION
(
12
,
"{
\"
a
\"
:[1]"
);
// non-empty array
// RawNumber() is never called
TEST_TERMINATION
(
8
,
"[
\"
a
\"
"
);
TEST_TERMINATION
(
9
,
"[{"
);
TEST_TERMINATION
(
10
,
"[{
\"
a
\"
"
);
TEST_TERMINATION
(
11
,
"[{}"
);
TEST_TERMINATION
(
11
,
"[{
\"
a
\"
:1}"
);
// non-empty object
TEST_TERMINATION
(
12
,
"{
\"
a
\"
:["
);
TEST_TERMINATION
(
13
,
"{
\"
a
\"
:[]"
);
TEST_TERMINATION
(
13
,
"{
\"
a
\"
:[1]"
);
// non-empty array
}
TEST
(
Reader
,
ParseComments
)
{
...
...
test/unittest/valuetest.cpp
View file @
1ffb3359
...
...
@@ -1644,12 +1644,13 @@ struct TerminateHandler {
bool
Int64
(
int64_t
)
{
return
e
!=
4
;
}
bool
Uint64
(
uint64_t
)
{
return
e
!=
5
;
}
bool
Double
(
double
)
{
return
e
!=
6
;
}
bool
String
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
7
;
}
bool
StartObject
()
{
return
e
!=
8
;
}
bool
Key
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
9
;
}
bool
EndObject
(
SizeType
)
{
return
e
!=
10
;
}
bool
StartArray
()
{
return
e
!=
11
;
}
bool
EndArray
(
SizeType
)
{
return
e
!=
12
;
}
bool
RawNumber
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
7
;
}
bool
String
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
8
;
}
bool
StartObject
()
{
return
e
!=
9
;
}
bool
Key
(
const
char
*
,
SizeType
,
bool
)
{
return
e
!=
10
;
}
bool
EndObject
(
SizeType
)
{
return
e
!=
11
;
}
bool
StartArray
()
{
return
e
!=
12
;
}
bool
EndArray
(
SizeType
)
{
return
e
!=
13
;
}
};
#define TEST_TERMINATION(e, json)\
...
...
@@ -1670,12 +1671,13 @@ TEST(Value, AcceptTerminationByHandler) {
TEST_TERMINATION
(
4
,
"[-1234567890123456789]"
);
TEST_TERMINATION
(
5
,
"[9223372036854775808]"
);
TEST_TERMINATION
(
6
,
"[0.5]"
);
TEST_TERMINATION
(
7
,
"[
\"
a
\"
]"
);
TEST_TERMINATION
(
8
,
"[
{}
]"
);
TEST_TERMINATION
(
9
,
"[{
\"
a
\"
:1
}]"
);
TEST_TERMINATION
(
10
,
"[{}]"
);
TEST_TERMINATION
(
11
,
"
{
\"
a
\"
:[]}
"
);
// RawNumber() is never called
TEST_TERMINATION
(
8
,
"[
\"
a
\"
]"
);
TEST_TERMINATION
(
9
,
"[{}]"
);
TEST_TERMINATION
(
10
,
"[{
\"
a
\"
:1
}]"
);
TEST_TERMINATION
(
11
,
"
[{}]
"
);
TEST_TERMINATION
(
12
,
"{
\"
a
\"
:[]}"
);
TEST_TERMINATION
(
13
,
"{
\"
a
\"
:[]}"
);
}
struct
ValueIntComparer
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment