mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
Rename tests/JsonObject/invalid.cpp
to unbound.cpp
This commit is contained in:
@ -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)
|
||||
|
@ -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"));
|
Reference in New Issue
Block a user