Fixed issue #199
This commit is contained in:
parent
ff6f723195
commit
561accb068
3 changed files with 383 additions and 786 deletions
|
@ -12097,17 +12097,17 @@ TEST_CASE("regression tests")
|
|||
// unsigned integer parsing - expected to overflow and be stored as a float
|
||||
j = custom_json::parse("4294967296"); // 2^32
|
||||
CHECK(static_cast<int>(j.type()) == static_cast<int>(custom_json::value_t::number_float));
|
||||
CHECK(j.get<float>() == 4294967296.0);
|
||||
CHECK(j.get<float>() == 4294967296.0f);
|
||||
|
||||
// integer object creation - expected to wrap and still be stored as an integer
|
||||
j = -2147483649LL; // -2^31-1
|
||||
CHECK(static_cast<int>(j.type()) == static_cast<int>(custom_json::value_t::number_integer));
|
||||
CHECK(j.get<int32_t>() == 2147483647.0); // Wrap
|
||||
CHECK(j.get<int32_t>() == 2147483647); // Wrap
|
||||
|
||||
// integer parsing - expected to overflow and be stored as a float
|
||||
j = custom_json::parse("-2147483648"); // -2^31
|
||||
// integer parsing - expected to overflow and be stored as a float with rounding
|
||||
j = custom_json::parse("-2147483649"); // -2^31
|
||||
CHECK(static_cast<int>(j.type()) == static_cast<int>(custom_json::value_t::number_float));
|
||||
CHECK(j.get<float>() == -2147483648.0);
|
||||
CHECK(j.get<float>() == -2147483650.0f);
|
||||
}
|
||||
|
||||
SECTION("issue #93 reverse_iterator operator inheritance problem")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue