| 46 | } |
| 47 | |
| 48 | void |
| 49 | run() |
| 50 | { |
| 51 | check(condition::parse_error, error::syntax); |
| 52 | check(condition::parse_error, error::extra_data); |
| 53 | check(condition::parse_error, error::incomplete); |
| 54 | check(condition::parse_error, error::exponent_overflow); |
| 55 | check(condition::parse_error, error::too_deep); |
| 56 | check(condition::parse_error, error::illegal_leading_surrogate); |
| 57 | check(condition::parse_error, error::illegal_trailing_surrogate); |
| 58 | check(condition::parse_error, error::expected_hex_digit); |
| 59 | check(condition::parse_error, error::expected_utf16_escape); |
| 60 | check(condition::parse_error, error::object_too_large); |
| 61 | check(condition::parse_error, error::array_too_large); |
| 62 | check(condition::parse_error, error::key_too_large); |
| 63 | check(condition::parse_error, error::string_too_large); |
| 64 | check(condition::parse_error, error::number_too_large); |
| 65 | check(condition::parse_error, error::input_error); |
| 66 | |
| 67 | check(condition::pointer_parse_error, error::missing_slash); |
| 68 | check(condition::pointer_parse_error, error::invalid_escape); |
| 69 | |
| 70 | check(condition::pointer_use_error, error::token_not_number); |
| 71 | check(condition::pointer_use_error, error::value_is_scalar); |
| 72 | check(condition::pointer_use_error, error::not_found); |
| 73 | check(condition::pointer_use_error, error::token_overflow); |
| 74 | check(condition::pointer_use_error, error::past_the_end); |
| 75 | |
| 76 | check(condition::conversion_error, error::not_number); |
| 77 | check(condition::conversion_error, error::not_exact); |
| 78 | check(condition::conversion_error, error::not_null); |
| 79 | check(condition::conversion_error, error::not_bool); |
| 80 | check(condition::conversion_error, error::not_array); |
| 81 | check(condition::conversion_error, error::not_object); |
| 82 | check(condition::conversion_error, error::not_string); |
| 83 | check(condition::conversion_error, error::not_int64); |
| 84 | check(condition::conversion_error, error::not_uint64); |
| 85 | check(condition::conversion_error, error::not_double); |
| 86 | check(condition::conversion_error, error::not_integer); |
| 87 | check(condition::conversion_error, error::size_mismatch); |
| 88 | check(condition::conversion_error, error::exhausted_variants); |
| 89 | check(condition::conversion_error, error::unknown_name); |
| 90 | |
| 91 | check(condition::generic_error, error::exception); |
| 92 | check(condition::generic_error, error::out_of_range); |
| 93 | check(error::test_failure); |
| 94 | |
| 95 | // check std interop |
| 96 | std::error_code const ec = error::syntax; |
| 97 | BOOST_TEST(ec == error::syntax); |
| 98 | BOOST_TEST(ec == condition::parse_error); |
| 99 | } |
| 100 | }; |
| 101 | |
| 102 | TEST_SUITE(error_test, "boost.json.error"); |