entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json objects.
Change-Id: Ica33fb959d5680e86f3488510e0b841a7430fe2b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/test/test_entity-manager.cpp b/test/test_entity-manager.cpp
index 939136b..56b5697 100644
--- a/test/test_entity-manager.cpp
+++ b/test/test_entity-manager.cpp
@@ -730,3 +730,45 @@
BasicVariantType v = double(1.1);
EXPECT_FALSE(matchProbe(j, v));
}
+
+TEST(MatchProbe, objNeqString)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = "hello"s;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, objNeqFalse)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = false;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, objNeqTrue)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = true;
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, objNeqUint8)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = uint8_t(1);
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, objNeqInt32)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = int32_t(-1);
+ EXPECT_FALSE(matchProbe(j, v));
+}
+
+TEST(MatchProbe, objNeqDouble)
+{
+ nlohmann::json j = R"({"foo": "bar"})"_json;
+ BasicVariantType v = double(1.1);
+ EXPECT_FALSE(matchProbe(j, v));
+}