🚨 fixed some warnings
This commit is contained in:
parent
7bf007f2bc
commit
9a51fb4da2
3 changed files with 62 additions and 62 deletions
2
Makefile
2
Makefile
|
@ -95,7 +95,7 @@ pedantic_clang:
|
||||||
|
|
||||||
# calling GCC with most warnings
|
# calling GCC with most warnings
|
||||||
pedantic_gcc:
|
pedantic_gcc:
|
||||||
$(MAKE) json_unit CXX=g++ CXXFLAGS="\
|
$(MAKE) json_unit CXXFLAGS="\
|
||||||
-std=c++11 \
|
-std=c++11 \
|
||||||
-Wno-deprecated-declarations \
|
-Wno-deprecated-declarations \
|
||||||
-Werror \
|
-Werror \
|
||||||
|
|
|
@ -6775,7 +6775,7 @@ class serializer
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t type = utf8d[byte];
|
const uint8_t type = utf8d[byte];
|
||||||
state = utf8d[256 + state * 16 + type];
|
state = utf8d[256u + state * 16u + type];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -939,40 +939,40 @@ TEST_CASE("value conversion")
|
||||||
|
|
||||||
SECTION("std::map")
|
SECTION("std::map")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::map<std::string, int>>();
|
j1.get<std::map<std::string, int>>();
|
||||||
auto m2 = j2.get<std::map<std::string, unsigned int>>();
|
j2.get<std::map<std::string, unsigned int>>();
|
||||||
auto m3 = j3.get<std::map<std::string, double>>();
|
j3.get<std::map<std::string, double>>();
|
||||||
auto m4 = j4.get<std::map<std::string, bool>>();
|
j4.get<std::map<std::string, bool>>();
|
||||||
//auto m5 = j5.get<std::map<std::string, std::string>>();
|
j5.get<std::map<std::string, std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::unordered_map")
|
SECTION("std::unordered_map")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::unordered_map<std::string, int>>();
|
j1.get<std::unordered_map<std::string, int>>();
|
||||||
auto m2 = j2.get<std::unordered_map<std::string, unsigned int>>();
|
j2.get<std::unordered_map<std::string, unsigned int>>();
|
||||||
auto m3 = j3.get<std::unordered_map<std::string, double>>();
|
j3.get<std::unordered_map<std::string, double>>();
|
||||||
auto m4 = j4.get<std::unordered_map<std::string, bool>>();
|
j4.get<std::unordered_map<std::string, bool>>();
|
||||||
//auto m5 = j5.get<std::unordered_map<std::string, std::string>>();
|
j5.get<std::unordered_map<std::string, std::string>>();
|
||||||
//CHECK(m5["one"] == "eins");
|
//CHECK(m5["one"] == "eins");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::multimap")
|
SECTION("std::multimap")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::multimap<std::string, int>>();
|
j1.get<std::multimap<std::string, int>>();
|
||||||
auto m2 = j2.get<std::multimap<std::string, unsigned int>>();
|
j2.get<std::multimap<std::string, unsigned int>>();
|
||||||
auto m3 = j3.get<std::multimap<std::string, double>>();
|
j3.get<std::multimap<std::string, double>>();
|
||||||
auto m4 = j4.get<std::multimap<std::string, bool>>();
|
j4.get<std::multimap<std::string, bool>>();
|
||||||
//auto m5 = j5.get<std::multimap<std::string, std::string>>();
|
j5.get<std::multimap<std::string, std::string>>();
|
||||||
//CHECK(m5["one"] == "eins");
|
//CHECK(m5["one"] == "eins");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::unordered_multimap")
|
SECTION("std::unordered_multimap")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::unordered_multimap<std::string, int>>();
|
j1.get<std::unordered_multimap<std::string, int>>();
|
||||||
auto m2 = j2.get<std::unordered_multimap<std::string, unsigned int>>();
|
j2.get<std::unordered_multimap<std::string, unsigned int>>();
|
||||||
auto m3 = j3.get<std::unordered_multimap<std::string, double>>();
|
j3.get<std::unordered_multimap<std::string, double>>();
|
||||||
auto m4 = j4.get<std::unordered_multimap<std::string, bool>>();
|
j4.get<std::unordered_multimap<std::string, bool>>();
|
||||||
//auto m5 = j5.get<std::unordered_multimap<std::string, std::string>>();
|
j5.get<std::unordered_multimap<std::string, std::string>>();
|
||||||
//CHECK(m5["one"] == "eins");
|
//CHECK(m5["one"] == "eins");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -993,29 +993,29 @@ TEST_CASE("value conversion")
|
||||||
|
|
||||||
SECTION("std::list")
|
SECTION("std::list")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::list<int>>();
|
j1.get<std::list<int>>();
|
||||||
auto m2 = j2.get<std::list<unsigned int>>();
|
j2.get<std::list<unsigned int>>();
|
||||||
auto m3 = j3.get<std::list<double>>();
|
j3.get<std::list<double>>();
|
||||||
auto m4 = j4.get<std::list<bool>>();
|
j4.get<std::list<bool>>();
|
||||||
auto m5 = j5.get<std::list<std::string>>();
|
j5.get<std::list<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::forward_list")
|
SECTION("std::forward_list")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::forward_list<int>>();
|
j1.get<std::forward_list<int>>();
|
||||||
auto m2 = j2.get<std::forward_list<unsigned int>>();
|
j2.get<std::forward_list<unsigned int>>();
|
||||||
auto m3 = j3.get<std::forward_list<double>>();
|
j3.get<std::forward_list<double>>();
|
||||||
auto m4 = j4.get<std::forward_list<bool>>();
|
j4.get<std::forward_list<bool>>();
|
||||||
auto m5 = j5.get<std::forward_list<std::string>>();
|
j5.get<std::forward_list<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::array")
|
SECTION("std::array")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::array<int, 4>>();
|
j1.get<std::array<int, 4>>();
|
||||||
auto m2 = j2.get<std::array<unsigned int, 3>>();
|
j2.get<std::array<unsigned int, 3>>();
|
||||||
auto m3 = j3.get<std::array<double, 4>>();
|
j3.get<std::array<double, 4>>();
|
||||||
auto m4 = j4.get<std::array<bool, 3>>();
|
j4.get<std::array<bool, 3>>();
|
||||||
auto m5 = j5.get<std::array<std::string, 3>>();
|
j5.get<std::array<std::string, 3>>();
|
||||||
|
|
||||||
SECTION("std::array is larger than JSON")
|
SECTION("std::array is larger than JSON")
|
||||||
{
|
{
|
||||||
|
@ -1035,47 +1035,47 @@ TEST_CASE("value conversion")
|
||||||
|
|
||||||
SECTION("std::valarray")
|
SECTION("std::valarray")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::valarray<int>>();
|
j1.get<std::valarray<int>>();
|
||||||
auto m2 = j2.get<std::valarray<unsigned int>>();
|
j2.get<std::valarray<unsigned int>>();
|
||||||
auto m3 = j3.get<std::valarray<double>>();
|
j3.get<std::valarray<double>>();
|
||||||
auto m4 = j4.get<std::valarray<bool>>();
|
j4.get<std::valarray<bool>>();
|
||||||
auto m5 = j5.get<std::valarray<std::string>>();
|
j5.get<std::valarray<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::vector")
|
SECTION("std::vector")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::vector<int>>();
|
j1.get<std::vector<int>>();
|
||||||
auto m2 = j2.get<std::vector<unsigned int>>();
|
j2.get<std::vector<unsigned int>>();
|
||||||
auto m3 = j3.get<std::vector<double>>();
|
j3.get<std::vector<double>>();
|
||||||
auto m4 = j4.get<std::vector<bool>>();
|
j4.get<std::vector<bool>>();
|
||||||
auto m5 = j5.get<std::vector<std::string>>();
|
j5.get<std::vector<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::deque")
|
SECTION("std::deque")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::deque<int>>();
|
j1.get<std::deque<int>>();
|
||||||
auto m2 = j2.get<std::deque<unsigned int>>();
|
j2.get<std::deque<unsigned int>>();
|
||||||
auto m3 = j2.get<std::deque<double>>();
|
j2.get<std::deque<double>>();
|
||||||
auto m4 = j4.get<std::deque<bool>>();
|
j4.get<std::deque<bool>>();
|
||||||
auto m5 = j5.get<std::deque<std::string>>();
|
j5.get<std::deque<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::set")
|
SECTION("std::set")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::set<int>>();
|
j1.get<std::set<int>>();
|
||||||
auto m2 = j2.get<std::set<unsigned int>>();
|
j2.get<std::set<unsigned int>>();
|
||||||
auto m3 = j3.get<std::set<double>>();
|
j3.get<std::set<double>>();
|
||||||
auto m4 = j4.get<std::set<bool>>();
|
j4.get<std::set<bool>>();
|
||||||
auto m5 = j5.get<std::set<std::string>>();
|
j5.get<std::set<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("std::unordered_set")
|
SECTION("std::unordered_set")
|
||||||
{
|
{
|
||||||
auto m1 = j1.get<std::unordered_set<int>>();
|
j1.get<std::unordered_set<int>>();
|
||||||
auto m2 = j2.get<std::unordered_set<unsigned int>>();
|
j2.get<std::unordered_set<unsigned int>>();
|
||||||
auto m3 = j3.get<std::unordered_set<double>>();
|
j3.get<std::unordered_set<double>>();
|
||||||
auto m4 = j4.get<std::unordered_set<bool>>();
|
j4.get<std::unordered_set<bool>>();
|
||||||
auto m5 = j5.get<std::unordered_set<std::string>>();
|
j5.get<std::unordered_set<std::string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("exception in case of a non-object type")
|
SECTION("exception in case of a non-object type")
|
||||||
|
|
Loading…
Reference in a new issue