Add C++17 copies of the test binaries (#3101)

* ⚗️ add C++17 copies of the test binaries
* ⚗️ use proper header for filesystem
* 🚨 fix warnings
* ⚗️ do not use too old compilers with C++17
* ✅ add test
* 🔨 add more constraints #3097
* ⚗️ use fix from https://github.com/nlohmann/json/pull/3101#issuecomment-998788786
* ⚗️ use fix from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90050
* 👷 use published CI image
This commit is contained in:
Niels Lohmann authored and GitHub committed 2021-12-29 09:47:05 +01:00
1 parent 825d3230d1
commit 6d3115924c
27 files changed
+442 -138

No files matched your search

+7 -7
View File
@@ -170,7 +170,7 @@ TEST_CASE("regression tests 1")
json::number_float_t f1{j1};
CHECK(std::isnan(f1));
json j2 = json::number_float_t(NAN);
json j2 = static_cast<json::number_float_t>(NAN);
CHECK(j2.is_number_float());
json::number_float_t f2{j2};
CHECK(std::isnan(f2));
@@ -183,7 +183,7 @@ TEST_CASE("regression tests 1")
json::number_float_t f1{j1};
CHECK(!std::isfinite(f1));
json j2 = json::number_float_t(INFINITY);
json j2 = static_cast<json::number_float_t>(INFINITY);
CHECK(j2.is_number_float());
json::number_float_t f2{j2};
CHECK(!std::isfinite(f2));
@@ -205,7 +205,7 @@ TEST_CASE("regression tests 1")
// check if the actual value was stored
CHECK(j2 == 102);
static_assert(std::is_same<decltype(anon_enum_value), decltype(u)>::value, "");
static_assert(std::is_same<decltype(anon_enum_value), decltype(u)>::value, "types must be the same");
j.push_back(json::object(
{
@@ -567,17 +567,17 @@ TEST_CASE("regression tests 1")
SECTION("issue #378 - locale-independent num-to-str")
{
setlocale(LC_NUMERIC, "de_DE.UTF-8");
static_cast<void>(setlocale(LC_NUMERIC, "de_DE.UTF-8"));
// verify that dumped correctly with '.' and no grouping
const json j1 = 12345.67;
CHECK(json(12345.67).dump() == "12345.67");
setlocale(LC_NUMERIC, "C");
static_cast<void>(setlocale(LC_NUMERIC, "C"));
}
SECTION("issue #379 - locale-independent str-to-num")
{
setlocale(LC_NUMERIC, "de_DE.UTF-8");
static_cast<void>(setlocale(LC_NUMERIC, "de_DE.UTF-8"));
// verify that parsed correctly despite using strtod internally
CHECK(json::parse("3.14").get<double>() == 3.14);
@@ -910,7 +910,7 @@ TEST_CASE("regression tests 1")
++i;
}
std::remove("test.json");
static_cast<void>(std::remove("test.json"));
}
}