Fixes to get unit tests to compile
There are 2 CI failures that started showing up at the same time:
1) sdbusplus recenty had a commit that started checking the return code
on sd_bus_add_object_vtable and now 2 tests are getting those fails
in CI, so used the mocked bus objects instead.
2) pel_values_test.cpp fails with:
Expected equality of these values:
"cec_service_network"
Which is: 0x563efae570fc
std::get<registryNamePos>(*s)
Which is: 0x563efae57a64
because it is using EXPECT_EQ to compare to char* values instead of
EXPECT_STREQ. I'm not sure what changed that uncovered this.
Fix them both at the same time as CI won't pass when doing them
separately because of the other error.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I937bd6d6965be5c8aab26f6c539cf30537439e0b
diff --git a/test/serialization_tests.hpp b/test/serialization_tests.hpp
index 6e41379..7831ce2 100644
--- a/test/serialization_tests.hpp
+++ b/test/serialization_tests.hpp
@@ -6,6 +6,7 @@
#include <experimental/filesystem>
#include <sdbusplus/bus.hpp>
+#include <sdbusplus/test/sdbus_mock.hpp>
#include <gtest/gtest.h>
@@ -19,7 +20,8 @@
namespace fs = std::experimental::filesystem;
char tmplt[] = "/tmp/logging_test.XXXXXX";
-auto bus = sdbusplus::bus::new_default();
+sdbusplus::SdBusMock sdbusMock;
+sdbusplus::bus::bus bus = sdbusplus::get_mocked_new(&sdbusMock);
phosphor::logging::internal::Manager manager(bus, OBJ_INTERNAL);
class TestSerialization : public testing::Test