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
8ba1f84f
Commit
8ba1f84f
authored
Aug 05, 2017
by
bluehero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify unittest
parent
9eb7bf89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
documenttest.cpp
test/unittest/documenttest.cpp
+10
-11
No files found.
test/unittest/documenttest.cpp
View file @
8ba1f84f
...
...
@@ -290,14 +290,6 @@ TEST(Document, ParseStream_AutoUTFInputStream) {
EXPECT_EQ
(
0
,
memcmp
(
bos
.
GetString
(),
bos2
.
GetString
(),
bos2
.
GetSize
()));
}
TEST
(
Document
,
Assignment
)
{
Value
x
(
1234
);
Document
d
;
d
=
x
;
EXPECT_TRUE
(
x
.
IsNull
());
// move semantic
EXPECT_EQ
(
1234
,
d
.
GetInt
());
}
TEST
(
Document
,
Swap
)
{
Document
d1
;
Document
::
AllocatorType
&
a
=
d1
.
GetAllocator
();
...
...
@@ -667,13 +659,20 @@ TYPED_TEST(DocumentMove, MoveAssignmentStack) {
#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
// Issue 22: Memory corruption via operator=
// Issue 22: Memory corruption via operator=
from Document
// Fixed by making unimplemented assignment operator private.
//TEST(Document, Assignment) {
// Prohibit assignment from Document, But allow assignment from Value
TEST
(
Document
,
Assignment
)
{
// Document d1;
// Document d2;
// d1 = d2;
//}
Value
x
(
1234
);
Document
d
;
d
=
x
;
EXPECT_TRUE
(
x
.
IsNull
());
// move semantic
EXPECT_EQ
(
1234
,
d
.
GetInt
());
}
#ifdef __clang__
RAPIDJSON_DIAG_POP
...
...
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