From e5576bf2a145117c583c3ad05fec3a08aa90993d Mon Sep 17 00:00:00 2001 From: Marri Devender Rao Date: Mon, 16 Apr 2018 05:56:11 -0500 Subject: Add unit test for watches created on object paths Verify the watches created for the object path being watched for 'interfaces added' signal. Resolves openbmc/openbmc#3003 Change-Id: I88a3adbbe91fcbe5bdf606d2f460d4d0c6d9c1a2 Signed-off-by: Marri Devender Rao --- src/test/interfaceaddtest.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/interfaceaddtest.cpp (limited to 'src/test/interfaceaddtest.cpp') diff --git a/src/test/interfaceaddtest.cpp b/src/test/interfaceaddtest.cpp new file mode 100644 index 0000000..d80f437 --- /dev/null +++ b/src/test/interfaceaddtest.cpp @@ -0,0 +1,28 @@ +#include +#include +#include +#include "pathwatchimpl.hpp" +#include "event.hpp" + +using namespace std::string_literals; +using namespace phosphor::dbus::monitoring; + +#include "interfaceaddtest.hpp" + +const std::array expectedPaths = { + "/xyz/openbmc_project/testing/inst1"s, +}; + +const std::array expectedWatches = { + "/xyz/openbmc_project/testing/inst1"s, +}; + +TEST(InterfaceAddTest, PathsSameSize) +{ + ASSERT_EQ(sizeof(expectedPaths), sizeof(paths)); +} + +TEST(InterfaceAddTest, WatchSameSize) +{ + ASSERT_EQ(expectedWatches.size(), pathwatches.size()); +} \ No newline at end of file -- cgit v1.2.1