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
9378001e
Commit
9378001e
authored
9 years ago
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documenttest.cpp: check/use conversion from Document to ParseResult
parent
98959e28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
documenttest.cpp
test/unittest/documenttest.cpp
+8
-2
No files found.
test/unittest/documenttest.cpp
View file @
9378001e
...
...
@@ -28,6 +28,7 @@ void ParseCheck(DocumentType& doc) {
typedef
typename
DocumentType
::
ValueType
ValueType
;
EXPECT_FALSE
(
doc
.
HasParseError
());
EXPECT_TRUE
((
ParseResult
)
doc
);
EXPECT_TRUE
(
doc
.
IsObject
());
...
...
@@ -99,13 +100,18 @@ TEST(Document, UnchangedOnParseError) {
Document
doc
;
doc
.
SetArray
().
PushBack
(
0
,
doc
.
GetAllocator
());
doc
.
Parse
(
"{]"
);
ParseResult
err
=
doc
.
Parse
(
"{]"
);
EXPECT_TRUE
(
doc
.
HasParseError
());
EXPECT_EQ
(
err
.
Code
(),
doc
.
GetParseError
());
EXPECT_EQ
(
err
.
Offset
(),
doc
.
GetErrorOffset
());
EXPECT_TRUE
(
doc
.
IsArray
());
EXPECT_EQ
(
doc
.
Size
(),
1u
);
doc
.
Parse
(
"{}"
);
err
=
doc
.
Parse
(
"{}"
);
EXPECT_FALSE
(
doc
.
HasParseError
());
EXPECT_FALSE
(
err
.
IsError
());
EXPECT_EQ
(
err
.
Code
(),
doc
.
GetParseError
());
EXPECT_EQ
(
err
.
Offset
(),
doc
.
GetErrorOffset
());
EXPECT_TRUE
(
doc
.
IsObject
());
EXPECT_EQ
(
doc
.
MemberCount
(),
0u
);
}
...
...
This diff is collapsed.
Click to expand it.
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