Skip to content

Commit

Permalink
fixed test case (for the moment)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Nov 13, 2016
1 parent 28d0542 commit 54224e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8954,7 +8954,7 @@ class basic_json
else if (codepoint >= 0xDC00 and codepoint <= 0xDFFF)
{
// we found a lone low surrogate
throw std::invalid_argument("missing high surrogate");
JSON_THROW(std::invalid_argument("missing high surrogate"));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -8103,7 +8103,7 @@ class basic_json
else if (codepoint >= 0xDC00 and codepoint <= 0xDFFF)
{
// we found a lone low surrogate
throw std::invalid_argument("missing high surrogate");
JSON_THROW(std::invalid_argument("missing high surrogate"));
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions test/src/unit-allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ SOFTWARE.
using nlohmann::json;

// allow to disable exceptions
#ifndef __cpp_exceptions
#define try if (true)
#define catch(X) if (false)
#define throw(X) std::abort()
#endif
//#ifndef __cpp_exceptions
// #define try if (true)
// #define catch(X) if (false)
// #define throw(X) std::abort()
//#endif

// special test case to check if memory is leaked if constructor throws

Expand All @@ -51,7 +51,7 @@ struct bad_allocator : std::allocator<T>
}
};

TEST_CASE("bad_alloc")
TEST_CASE("bad_alloc", "[throw]")
{
SECTION("bad_alloc")
{
Expand Down Expand Up @@ -118,7 +118,7 @@ struct my_allocator : std::allocator<T>
}
};

TEST_CASE("controlled bad_alloc")
TEST_CASE("controlled bad_alloc", "[throw]")
{
// create JSON type using the throwing allocator
using my_json = nlohmann::basic_json<std::map,
Expand Down

0 comments on commit 54224e3

Please sign in to comment.