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
a35d93e9
Commit
a35d93e9
authored
Feb 08, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try with GCC 4.9
parent
d6f54711
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
351 additions
and
3 deletions
+351
-3
.travis.yml
.travis.yml
+3
-3
test/unit.cpp
test/unit.cpp
+348
-0
No files found.
.travis.yml
View file @
a35d93e9
...
@@ -6,8 +6,8 @@ compiler:
...
@@ -6,8 +6,8 @@ compiler:
before_install
:
before_install
:
-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
-
sudo apt-get update -qq
-
sudo apt-get update -qq
-
if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.
8
; fi
-
if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.
9
; fi
-
if [ "$CXX" = "g++" ]; then export CXX="g++-4.
8" CC="gcc-4.8
"; fi
-
if [ "$CXX" = "g++" ]; then export CXX="g++-4.
9" CC="gcc-4.9
"; fi
-
sudo pip install cpp-coveralls pyyaml
-
sudo pip install cpp-coveralls pyyaml
-
sudo apt-get install valgrind
-
sudo apt-get install valgrind
...
@@ -24,4 +24,4 @@ after_success:
...
@@ -24,4 +24,4 @@ after_success:
-
make clean
-
make clean
-
make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage"
-
make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage"
-
./json_unit
-
./json_unit
-
coveralls --
gcov-options '\-lp' --gcov 'gcov-4.8
'
-
coveralls --
exclude test/catch.hpp --exclude test/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9
'
test/unit.cpp
View file @
a35d93e9
...
@@ -1478,6 +1478,150 @@ TEST_CASE("value conversion")
...
@@ -1478,6 +1478,150 @@ TEST_CASE("value conversion")
CHECK
(
json
(
n
)
==
j
);
CHECK
(
json
(
n
)
==
j
);
}
}
SECTION
(
"int8_t"
)
{
int8_t
n
=
j
.
get
<
int8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_t"
)
{
int16_t
n
=
j
.
get
<
int16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_t"
)
{
int32_t
n
=
j
.
get
<
int32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_t"
)
{
int64_t
n
=
j
.
get
<
int64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int8_fast_t"
)
{
int_fast8_t
n
=
j
.
get
<
int_fast8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_fast_t"
)
{
int_fast16_t
n
=
j
.
get
<
int_fast16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_fast_t"
)
{
int_fast32_t
n
=
j
.
get
<
int_fast32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_fast_t"
)
{
int_fast64_t
n
=
j
.
get
<
int_fast64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int8_least_t"
)
{
int_least8_t
n
=
j
.
get
<
int_least8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_least_t"
)
{
int_least16_t
n
=
j
.
get
<
int_least16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_least_t"
)
{
int_least32_t
n
=
j
.
get
<
int_least32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_least_t"
)
{
int_least64_t
n
=
j
.
get
<
int_least64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_t"
)
{
uint8_t
n
=
j
.
get
<
uint8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_t"
)
{
uint16_t
n
=
j
.
get
<
uint16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_t"
)
{
uint32_t
n
=
j
.
get
<
uint32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_t"
)
{
uint64_t
n
=
j
.
get
<
uint64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_fast_t"
)
{
uint_fast8_t
n
=
j
.
get
<
uint_fast8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_fast_t"
)
{
uint_fast16_t
n
=
j
.
get
<
uint_fast16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_fast_t"
)
{
uint_fast32_t
n
=
j
.
get
<
uint_fast32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_fast_t"
)
{
uint_fast64_t
n
=
j
.
get
<
uint_fast64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_least_t"
)
{
uint_least8_t
n
=
j
.
get
<
uint_least8_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_least_t"
)
{
uint_least16_t
n
=
j
.
get
<
uint_least16_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_least_t"
)
{
uint_least32_t
n
=
j
.
get
<
uint_least32_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_least_t"
)
{
uint_least64_t
n
=
j
.
get
<
uint_least64_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"exception in case of a non-number type"
)
SECTION
(
"exception in case of a non-number type"
)
{
{
CHECK_THROWS_AS
(
json
(
json
::
value_t
::
null
).
get
<
json
::
number_integer_t
>
(),
std
::
logic_error
);
CHECK_THROWS_AS
(
json
(
json
::
value_t
::
null
).
get
<
json
::
number_integer_t
>
(),
std
::
logic_error
);
...
@@ -1488,4 +1632,208 @@ TEST_CASE("value conversion")
...
@@ -1488,4 +1632,208 @@ TEST_CASE("value conversion")
CHECK_NOTHROW
(
json
(
json
::
value_t
::
number_float
).
get
<
json
::
number_integer_t
>
());
CHECK_NOTHROW
(
json
(
json
::
value_t
::
number_float
).
get
<
json
::
number_integer_t
>
());
}
}
}
}
SECTION
(
"get an integer number (implicit)"
)
{
json
::
number_integer_t
n_reference
{
42
};
json
j
(
n_reference
);
SECTION
(
"number_integer_t"
)
{
json
::
number_integer_t
n
=
j
.
get
<
json
::
number_integer_t
>
();
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"short"
)
{
short
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"unsigned short"
)
{
unsigned
short
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int"
)
{
int
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"unsigned int"
)
{
unsigned
int
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"long"
)
{
long
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"unsigned long"
)
{
unsigned
long
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"long long"
)
{
long
long
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"unsigned long long"
)
{
unsigned
long
long
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int8_t"
)
{
int8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_t"
)
{
int16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_t"
)
{
int32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_t"
)
{
int64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int8_fast_t"
)
{
int_fast8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_fast_t"
)
{
int_fast16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_fast_t"
)
{
int_fast32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_fast_t"
)
{
int_fast64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int8_least_t"
)
{
int_least8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int16_least_t"
)
{
int_least16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int32_least_t"
)
{
int_least32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"int64_least_t"
)
{
int_least64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_t"
)
{
uint8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_t"
)
{
uint16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_t"
)
{
uint32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_t"
)
{
uint64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_fast_t"
)
{
uint_fast8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_fast_t"
)
{
uint_fast16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_fast_t"
)
{
uint_fast32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_fast_t"
)
{
uint_fast64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint8_least_t"
)
{
uint_least8_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint16_least_t"
)
{
uint_least16_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint32_least_t"
)
{
uint_least32_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
SECTION
(
"uint64_least_t"
)
{
uint_least64_t
n
=
j
;
CHECK
(
json
(
n
)
==
j
);
}
}
}
}
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