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
44f2f9aa
Commit
44f2f9aa
authored
7 years ago
by
Étienne Dupuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added relevant unit tests for issue #1108 suggested improvement.
parent
86e280f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
pointertest.cpp
test/unittest/pointertest.cpp
+7
-2
No files found.
test/unittest/pointertest.cpp
View file @
44f2f9aa
...
...
@@ -462,7 +462,8 @@ TEST(Pointer, ConstructorWithToken) {
TEST
(
Pointer
,
CopyConstructor
)
{
{
Pointer
p
(
"/foo/0"
);
CrtAllocator
allocator
;
Pointer
p
(
"/foo/0"
,
&
allocator
);
Pointer
q
(
p
);
EXPECT_TRUE
(
q
.
IsValid
());
EXPECT_EQ
(
2u
,
q
.
GetTokenCount
());
...
...
@@ -471,6 +472,7 @@ TEST(Pointer, CopyConstructor) {
EXPECT_EQ
(
1u
,
q
.
GetTokens
()[
1
].
length
);
EXPECT_STREQ
(
"0"
,
q
.
GetTokens
()[
1
].
name
);
EXPECT_EQ
(
0u
,
q
.
GetTokens
()[
1
].
index
);
EXPECT_EQ
(
&
p
.
GetAllocator
(),
&
q
.
GetAllocator
());
}
// Static tokens
...
...
@@ -489,7 +491,8 @@ TEST(Pointer, CopyConstructor) {
TEST
(
Pointer
,
Assignment
)
{
{
Pointer
p
(
"/foo/0"
);
CrtAllocator
allocator
;
Pointer
p
(
"/foo/0"
,
&
allocator
);
Pointer
q
;
q
=
p
;
EXPECT_TRUE
(
q
.
IsValid
());
...
...
@@ -499,6 +502,7 @@ TEST(Pointer, Assignment) {
EXPECT_EQ
(
1u
,
q
.
GetTokens
()[
1
].
length
);
EXPECT_STREQ
(
"0"
,
q
.
GetTokens
()[
1
].
name
);
EXPECT_EQ
(
0u
,
q
.
GetTokens
()[
1
].
index
);
EXPECT_NE
(
&
p
.
GetAllocator
(),
&
q
.
GetAllocator
());
q
=
q
;
EXPECT_TRUE
(
q
.
IsValid
());
EXPECT_EQ
(
2u
,
q
.
GetTokenCount
());
...
...
@@ -507,6 +511,7 @@ TEST(Pointer, Assignment) {
EXPECT_EQ
(
1u
,
q
.
GetTokens
()[
1
].
length
);
EXPECT_STREQ
(
"0"
,
q
.
GetTokens
()[
1
].
name
);
EXPECT_EQ
(
0u
,
q
.
GetTokens
()[
1
].
index
);
EXPECT_NE
(
&
p
.
GetAllocator
(),
&
q
.
GetAllocator
());
}
// Static tokens
...
...
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