Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
ee45bca4
Commit
ee45bca4
authored
Jan 20, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ more test cases
parent
75ba6ae4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
test/json_unit.cc
test/json_unit.cc
+7
-0
No files found.
test/json_unit.cc
View file @
ee45bca4
...
...
@@ -41,6 +41,7 @@ TEST_CASE("array")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int64_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
double
>
(),
std
::
logic_error
);
// transparent usage
...
...
@@ -360,6 +361,7 @@ TEST_CASE("object")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int64_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
double
>
(),
std
::
logic_error
);
// transparent usage
...
...
@@ -776,6 +778,7 @@ TEST_CASE("null")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int64_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
double
>
(),
std
::
logic_error
);
// copy constructor
...
...
@@ -859,6 +862,7 @@ TEST_CASE("string")
CHECK_NOTHROW
(
auto
v
=
static_cast
<
std
::
string
>
(
j
));
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int64_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
double
>
(),
std
::
logic_error
);
// transparent usage
...
...
@@ -968,6 +972,7 @@ TEST_CASE("boolean")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
bool
>
());
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
int64_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
double
>
(),
std
::
logic_error
);
// transparent usage
...
...
@@ -1063,6 +1068,7 @@ TEST_CASE("number (int)")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
int
>
());
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
int64_t
>
());
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
double
>
());
// transparent usage
...
...
@@ -1173,6 +1179,7 @@ TEST_CASE("number (float)")
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
std
::
string
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
auto
v
=
j
.
get
<
bool
>
(),
std
::
logic_error
);
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
int
>
());
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
int64_t
>
());
CHECK_NOTHROW
(
auto
v
=
j
.
get
<
double
>
());
// transparent usage
...
...
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