forked from bblanchon/ArduinoJson
committed by
Benoit Blanchon
parent
cd4bf33132
commit
18a9a5b590
@ -113,6 +113,42 @@ TEST_CASE("Compare JsonVariant with JsonVariant") {
|
||||
CHECK_FALSE(a == b);
|
||||
}
|
||||
|
||||
SECTION("MsgPackBinary('abc') vs MsgPackBinary('abc')") {
|
||||
a.set(MsgPackBinary("abc", 4));
|
||||
b.set(MsgPackBinary("abc", 4));
|
||||
|
||||
CHECK(a == b);
|
||||
CHECK(a <= b);
|
||||
CHECK(a >= b);
|
||||
CHECK_FALSE(a != b);
|
||||
CHECK_FALSE(a < b);
|
||||
CHECK_FALSE(a > b);
|
||||
}
|
||||
|
||||
SECTION("MsgPackBinary('abc') vs MsgPackBinary('bcd')") {
|
||||
a.set(MsgPackBinary("abc", 4));
|
||||
b.set(MsgPackBinary("bcd", 4));
|
||||
|
||||
CHECK(a != b);
|
||||
CHECK(a < b);
|
||||
CHECK(a <= b);
|
||||
CHECK_FALSE(a == b);
|
||||
CHECK_FALSE(a > b);
|
||||
CHECK_FALSE(a >= b);
|
||||
}
|
||||
|
||||
SECTION("MsgPackBinary('bcd') vs MsgPackBinary('abc')") {
|
||||
a.set(MsgPackBinary("bcd", 4));
|
||||
b.set(MsgPackBinary("abc", 4));
|
||||
|
||||
CHECK(a != b);
|
||||
CHECK(a > b);
|
||||
CHECK(a >= b);
|
||||
CHECK_FALSE(a < b);
|
||||
CHECK_FALSE(a <= b);
|
||||
CHECK_FALSE(a == b);
|
||||
}
|
||||
|
||||
SECTION("false vs true") {
|
||||
a.set(false);
|
||||
b.set(true);
|
||||
|
@ -21,6 +21,8 @@ TEST_CASE("Unbound JsonVariant") {
|
||||
CHECK(variant.as<JsonObject>().isNull());
|
||||
CHECK(variant.as<JsonObjectConst>().isNull());
|
||||
CHECK(variant.as<JsonString>().isNull());
|
||||
CHECK(variant.as<MsgPackBinary>().data() == nullptr);
|
||||
CHECK(variant.as<MsgPackBinary>().size() == 0);
|
||||
}
|
||||
|
||||
SECTION("is<T>()") {
|
||||
@ -46,6 +48,7 @@ TEST_CASE("Unbound JsonVariant") {
|
||||
CHECK_FALSE(variant.set(serialized("42")));
|
||||
CHECK_FALSE(variant.set(serialized(std::string("42"))));
|
||||
CHECK_FALSE(variant.set(true));
|
||||
CHECK_FALSE(variant.set(MsgPackBinary("hello", 5)));
|
||||
}
|
||||
|
||||
SECTION("add()") {
|
||||
|
Reference in New Issue
Block a user