summaryrefslogtreecommitdiffstats
path: root/src/test/interfaceaddtest.cpp
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2018-04-16 05:56:11 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-06-05 02:10:49 +0000
commite5576bf2a145117c583c3ad05fec3a08aa90993d (patch)
tree8421f819b81a3b8e1b0f343aedfe02083607274b /src/test/interfaceaddtest.cpp
parent80c70610a0ea96cf609387638f9f3f9bee0c581d (diff)
downloadphosphor-dbus-monitor-e5576bf2a145117c583c3ad05fec3a08aa90993d.tar.gz
phosphor-dbus-monitor-e5576bf2a145117c583c3ad05fec3a08aa90993d.zip
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 <devenrao@in.ibm.com>
Diffstat (limited to 'src/test/interfaceaddtest.cpp')
-rw-r--r--src/test/interfaceaddtest.cpp28
1 files changed, 28 insertions, 0 deletions
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 <array>
+#include <string>
+#include <gtest/gtest.h>
+#include "pathwatchimpl.hpp"
+#include "event.hpp"
+
+using namespace std::string_literals;
+using namespace phosphor::dbus::monitoring;
+
+#include "interfaceaddtest.hpp"
+
+const std::array<std::string, 1> expectedPaths = {
+ "/xyz/openbmc_project/testing/inst1"s,
+};
+
+const std::array<std::string, 1> 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
OpenPOWER on IntegriCloud