Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kkarbowiak committed Mar 17, 2022
1 parent 59e51e8 commit 4741215
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 234 deletions.
142 changes: 71 additions & 71 deletions test/src/unit-class_parser.cpp

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions test/src/unit-conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ TEST_CASE("value conversion")
json(json::value_t::string).get<json::object_t>(),
"[json.exception.type_error.302] type must be object, but is string", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::boolean).get<json::object_t>(),
"[json.exception.type_error.302] type must be object, "
"but is boolean", json::type_error&);
"[json.exception.type_error.302] type must be object, "
"but is boolean", json::type_error&);
CHECK_THROWS_WITH_AS(
json(json::value_t::number_integer).get<json::object_t>(),
"[json.exception.type_error.302] type must be object, but is number", json::type_error&);
Expand Down Expand Up @@ -447,8 +447,8 @@ TEST_CASE("value conversion")
json(json::value_t::array).get<json::string_t>(),
"[json.exception.type_error.302] type must be string, but is array", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::boolean).get<json::string_t>(),
"[json.exception.type_error.302] type must be string, "
"but is boolean", json::type_error&);
"[json.exception.type_error.302] type must be string, "
"but is boolean", json::type_error&);
CHECK_THROWS_WITH_AS(
json(json::value_t::number_integer).get<json::string_t>(),
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
Expand All @@ -464,19 +464,19 @@ TEST_CASE("value conversion")
SECTION("exception in case of a non-string type using string_view")
{
CHECK_THROWS_WITH_AS(json(json::value_t::null).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is null", json::type_error&);
"[json.exception.type_error.302] type must be string, but is null", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::object).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is object", json::type_error&);
"[json.exception.type_error.302] type must be string, but is object", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::array).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is array", json::type_error&);
"[json.exception.type_error.302] type must be string, but is array", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::boolean).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is boolean", json::type_error&);
"[json.exception.type_error.302] type must be string, but is boolean", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_integer).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_unsigned).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_float).get<std::string_view>(),
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
"[json.exception.type_error.302] type must be string, but is number", json::type_error&);
}
#endif
}
Expand Down Expand Up @@ -519,19 +519,19 @@ TEST_CASE("value conversion")
CHECK(n2 == n);

CHECK_THROWS_WITH_AS(json(json::value_t::string).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is string", json::type_error&);
"[json.exception.type_error.302] type must be null, but is string", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::object).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is object", json::type_error&);
"[json.exception.type_error.302] type must be null, but is object", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::array).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is array", json::type_error&);
"[json.exception.type_error.302] type must be null, but is array", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::boolean).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is boolean", json::type_error&);
"[json.exception.type_error.302] type must be null, but is boolean", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_integer).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_unsigned).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::number_float).get<std::nullptr_t>(),
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
"[json.exception.type_error.302] type must be null, but is number", json::type_error&);
}

#if JSON_USE_IMPLICIT_CONVERSIONS
Expand Down Expand Up @@ -594,14 +594,14 @@ TEST_CASE("value conversion")
json(json::value_t::null).get<json::boolean_t>(),
"[json.exception.type_error.302] type must be boolean, but is null", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::object).get<json::boolean_t>(),
"[json.exception.type_error.302] type must be boolean, "
"but is object", json::type_error&);
"[json.exception.type_error.302] type must be boolean, "
"but is object", json::type_error&);
CHECK_THROWS_WITH_AS(
json(json::value_t::array).get<json::boolean_t>(),
"[json.exception.type_error.302] type must be boolean, but is array", json::type_error&);
CHECK_THROWS_WITH_AS(json(json::value_t::string).get<json::boolean_t>(),
"[json.exception.type_error.302] type must be boolean, "
"but is string", json::type_error&);
"[json.exception.type_error.302] type must be boolean, "
"but is string", json::type_error&);
CHECK_THROWS_WITH_AS(
json(json::value_t::number_integer).get<json::boolean_t>(),
"[json.exception.type_error.302] type must be boolean, but is "
Expand Down Expand Up @@ -1387,7 +1387,7 @@ TEST_CASE("value conversion")
{
std::array<int, 6> arr6 = {{1, 2, 3, 4, 5, 6}};
CHECK_THROWS_WITH_AS(j1.get_to(arr6), "[json.exception.out_of_range.401] "
"array index 4 is out of range", json::out_of_range&);
"array index 4 is out of range", json::out_of_range&);
}

SECTION("std::array is smaller than JSON")
Expand Down Expand Up @@ -1455,11 +1455,11 @@ TEST_CASE("value conversion")
json j7 = {0, 1, 2, 3};
json j8 = 2;
CHECK_THROWS_WITH_AS((j7.get<std::map<int, int>>()),
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
CHECK_THROWS_WITH_AS((j8.get<std::map<int, int>>()),
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);

SECTION("superfluous entries")
{
Expand All @@ -1480,11 +1480,11 @@ TEST_CASE("value conversion")
json j7 = {0, 1, 2, 3};
json j8 = 2;
CHECK_THROWS_WITH_AS((j7.get<std::unordered_map<int, int>>()),
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
CHECK_THROWS_WITH_AS((j8.get<std::unordered_map<int, int>>()),
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);
"[json.exception.type_error.302] type must be array, "
"but is number", json::type_error&);

SECTION("superfluous entries")
{
Expand Down
22 changes: 11 additions & 11 deletions test/src/unit-element_access1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ TEST_CASE("element access 1")
SECTION("access outside bounds")
{
CHECK_THROWS_WITH_AS(j.at(8),
"[json.exception.out_of_range.401] array index 8 is out of range", json::out_of_range&);
"[json.exception.out_of_range.401] array index 8 is out of range", json::out_of_range&);
CHECK_THROWS_WITH_AS(j_const.at(8),
"[json.exception.out_of_range.401] array index 8 is out of range", json::out_of_range&);
"[json.exception.out_of_range.401] array index 8 is out of range", json::out_of_range&);
}

SECTION("access on non-array type")
Expand Down Expand Up @@ -379,26 +379,26 @@ TEST_CASE("element access 1")
json jarray2 = {"foo", "bar"};

CHECK_THROWS_WITH_AS(jarray.erase(jarray2.begin()),
"[json.exception.invalid_iterator.202] iterator does not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.202] iterator does not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray.begin(), jarray2.end()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray2.begin(), jarray.end()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray2.begin(), jarray2.end()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
}
{
json jarray = {1, 1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}};
json jarray2 = {"foo", "bar"};

CHECK_THROWS_WITH_AS(jarray.erase(jarray2.cbegin()),
"[json.exception.invalid_iterator.202] iterator does not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.202] iterator does not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray.cbegin(), jarray2.cend()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray2.cbegin(), jarray.cend()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
CHECK_THROWS_WITH_AS(jarray.erase(jarray2.cbegin(), jarray2.cend()),
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
"[json.exception.invalid_iterator.203] iterators do not fit current value", json::invalid_iterator&);
}
}
}
Expand Down Expand Up @@ -550,7 +550,7 @@ TEST_CASE("element access 1")
{
json j;
CHECK_THROWS_WITH_AS(j.erase(j.begin()),
"[json.exception.type_error.307] cannot use erase() with null", json::type_error&);
"[json.exception.type_error.307] cannot use erase() with null", json::type_error&);
}
}

Expand Down
Loading

0 comments on commit 4741215

Please sign in to comment.