|
|
@ -66,22 +66,22 @@ TEST_CASE("reference access")
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::object_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::object_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is object");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("const reference access to const object_t")
|
|
|
|
SECTION("const reference access to const object_t")
|
|
|
@ -115,23 +115,23 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::array_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::array_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is array");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("reference access to string_t")
|
|
|
|
SECTION("reference access to string_t")
|
|
|
@ -151,23 +151,23 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::string_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::string_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is string");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("reference access to boolean_t")
|
|
|
|
SECTION("reference access to boolean_t")
|
|
|
@ -187,23 +187,23 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::boolean_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::boolean_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is boolean");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("reference access to number_integer_t")
|
|
|
|
SECTION("reference access to number_integer_t")
|
|
|
@ -223,23 +223,23 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_integer_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_integer_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("reference access to number_unsigned_t")
|
|
|
|
SECTION("reference access to number_unsigned_t")
|
|
|
@ -259,23 +259,23 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
//CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
//CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
//CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
//CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
// "[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
// "[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_unsigned_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_unsigned_t&>());
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_float_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_float_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SECTION("reference access to number_float_t")
|
|
|
|
SECTION("reference access to number_float_t")
|
|
|
@ -295,22 +295,22 @@ TEST_CASE("reference access")
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
// check if mismatching references throw correctly
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::object_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::object_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::array_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::string_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::string_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::boolean_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::boolean_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_integer_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_integer_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_AS(value.get_ref<json::number_unsigned_t&>(), json::type_error&);
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
CHECK_THROWS_WITH(value.get_ref<json::number_unsigned_t&>(),
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number");
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_float_t&>());
|
|
|
|
CHECK_NOTHROW(value.get_ref<json::number_float_t&>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|