Rename tests/JsonObject/invalid.cpp to unbound.cpp

This commit is contained in:
Benoit Blanchon
2023-08-09 11:46:30 +02:00
parent adea7f4131
commit bc6707b10c
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,6 @@ add_executable(JsonObjectTests
containsKey.cpp
copy.cpp
equals.cpp
invalid.cpp
isNull.cpp
iterator.cpp
nesting.cpp
@ -16,6 +15,7 @@ add_executable(JsonObjectTests
size.cpp
std_string.cpp
subscript.cpp
unbound.cpp
)
add_test(JsonObject JsonObjectTests)

View File

@ -7,19 +7,19 @@
using namespace Catch::Matchers;
TEST_CASE("JsonObject::invalid()") {
TEST_CASE("Unbound JsonObject") {
JsonObject obj;
SECTION("SubscriptFails") {
SECTION("retrieve member") {
REQUIRE(obj["key"].isNull());
}
SECTION("AddFails") {
SECTION("add member") {
obj["hello"] = "world";
REQUIRE(0 == obj.size());
}
SECTION("serialize to 'null'") {
SECTION("serialize") {
char buffer[32];
serializeJson(obj, buffer, sizeof(buffer));
REQUIRE_THAT(buffer, Equals("null"));