Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
98af0887
Commit
98af0887
authored
Dec 28, 2014
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ more test cases
parent
ea85da8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
JSON.cc
src/JSON.cc
+6
-5
JSON_unit.cc
test/JSON_unit.cc
+15
-0
No files found.
src/JSON.cc
View file @
98af0887
...
...
@@ -477,11 +477,6 @@ const std::string JSON::toString() const noexcept
{
switch
(
_type
)
{
case
(
value_type
:
:
null
)
:
{
return
"null"
;
}
case
(
value_type
:
:
string
)
:
{
return
std
::
string
(
"
\"
"
)
+
*
_value
.
string
+
"
\"
"
;
...
...
@@ -533,6 +528,12 @@ const std::string JSON::toString() const noexcept
return
"{"
+
result
+
"}"
;
}
// actually only value_type::null - but making the compiler happy
default
:
{
return
"null"
;
}
}
}
...
...
test/JSON_unit.cc
View file @
98af0887
...
...
@@ -1394,6 +1394,21 @@ TEST_CASE("Iterators")
JSON
::
iterator
tmp1
(
j7
.
begin
());
JSON
::
const_iterator
tmp2
(
j7
.
cbegin
());
}
{
JSON
j_array
=
{
0
,
1
,
2
,
3
,
4
,
5
};
JSON
::
iterator
i1
=
j_array
.
begin
();
++
i1
;
JSON
::
iterator
i2
(
i1
);
JSON
::
iterator
i3
;
i3
=
i2
;
JSON
::
const_iterator
i4
=
j_array
.
begin
();
++
i4
;
JSON
::
const_iterator
i5
(
i4
);
JSON
::
const_iterator
i6
;
i6
=
i5
;
}
// iterator copy assignment
{
...
...
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