Don't rely on implicit operator comparison
Json has a bunch of implicit overloaded operators for comparing
vectors/arrays/maps with their json counterparts. Unfortunately, when
used in unit tests, these cause warnings in clang, so update the code to
use the ElementsAre check from gmock.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I658557cb59d568fd50cf6f3bef73d6f90b5c56cf
diff --git a/test/redfish-core/include/utils/json_utils_test.cpp b/test/redfish-core/include/utils/json_utils_test.cpp
index e97edf9..fa5e39a 100644
--- a/test/redfish-core/include/utils/json_utils_test.cpp
+++ b/test/redfish-core/include/utils/json_utils_test.cpp
@@ -121,7 +121,8 @@
ASSERT_TRUE(readJson(jsonRequest, res, "TestJson", jsonVec));
EXPECT_EQ(res.result(), boost::beast::http::status::ok);
EXPECT_THAT(res.jsonValue, IsEmpty());
- EXPECT_EQ(jsonVec, R"([{"hello": "yes"}, [{"there": "no"}, "nice"]])"_json);
+ EXPECT_THAT(jsonVec, ElementsAre(R"({"hello": "yes"})"_json,
+ R"([{"there": "no"}, "nice"])"_json));
}
TEST(ReadJson, JsonSubElementValueAreUnpackedCorrectly)