mirror of
https://github.com/nlohmann/json.git
synced 2026-11-02 10:55:35 +00:00
tests: skip throwing json_view bool get<T>() combinations without exceptions (#5988)
check_boolean_get_parity() called get<T>() for number_integer_t, number_unsigned_t and number_float_t in its JSON_NOEXCEPTION branch, but a boolean throws type_error.302 for exactly these types, so JSON_THROW aborted test-json_view_cpp11/cpp17 in ci_test_noexceptions. Skip these combinations there; the throwing checks stay in the exceptions-enabled build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5NasAgbDGG28MqXjQvLqp Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
1 file changed
+9
-1
@@ -1578,7 +1578,15 @@ void check_boolean_get_parity()
|
||||
CHECK(view_value == static_cast<T>(b));
|
||||
}
|
||||
#else
|
||||
CHECK(j.get<T>() == d.root().template get<T>());
|
||||
// without exceptions, the combinations that throw (number_integer_t, number_unsigned_t, number_float_t)
|
||||
// cannot be run: JSON_THROW aborts
|
||||
const bool throws = std::is_same<T, json::number_integer_t>::value
|
||||
|| std::is_same<T, json::number_unsigned_t>::value
|
||||
|| std::is_same<T, json::number_float_t>::value;
|
||||
if (!throws)
|
||||
{
|
||||
CHECK(j.get<T>() == d.root().template get<T>());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user