entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json null.
Change-Id: I00314b68a587ec9b6bef052fa7ba5a877ce36a15
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/test/test_entity-manager.cpp b/test/test_entity-manager.cpp
index 56b5697..a5786e5 100644
--- a/test/test_entity-manager.cpp
+++ b/test/test_entity-manager.cpp
@@ -772,3 +772,45 @@
BasicVariantType v = double(1.1);
EXPECT_FALSE(matchProbe(j, v));
}
+
+TEST(MatchProbe, nullNeqString)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = "hello"s;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, nullNeqFalse)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = false;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, nullNeqTrue)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = true;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, nullNeqUint8)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = uint8_t(1);
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, nullNeqInt32)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = int32_t(-1);
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, nullNeqDouble)
+{
+ nlohmann::json j = R"(null)"_json;
+ BasicVariantType v = double(1.1);
+ EXPECT_FALSE(matchProbe(j, v));
+}