summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-03-10 09:05:30 -0600
committerMatt Spinler <spinler@us.ibm.com>2017-03-14 15:37:27 -0500
commitc3bffed7e47080667008e8272c64a2612e9bd73c (patch)
tree0846a97dbf73ec3828416312a182d10b84600a8b /test
parent12bdf058149dcab523f91c77aa734076a1afacaa (diff)
downloadopenpower-proc-control-c3bffed7e47080667008e8272c64a2612e9bd73c.tar.gz
openpower-proc-control-c3bffed7e47080667008e8272c64a2612e9bd73c.zip
Have the Target class manage the file descriptor
The sysfs file descriptor will now stay open from first use until the Target class is destroyed. Change-Id: Ib9803a527115cc75ecc9a5351d1e748ccd54a993 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am3
-rw-r--r--test/utest.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index bf86e6a..e0d20a2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -13,4 +13,5 @@ utest_LDFLAGS = -lgtest_main -lgtest $(PTHREAD_LIBS) $(OESDK_TESTCASE_FLAGS) \
$(PHOSPHOR_LOGGING_LIBS) -lstdc++fs
utest_SOURCES = utest.cpp
-utest_LDADD = $(top_srcdir)/targeting.cpp $(top_srcdir)/registration.cpp
+utest_LDADD = $(top_srcdir)/targeting.cpp $(top_srcdir)/registration.cpp \
+ $(top_srcdir)/filedescriptor.cpp
diff --git a/test/utest.cpp b/test/utest.cpp
index 0d3c2c9..4572c55 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -62,7 +62,7 @@ TEST_F(TargetingTest, CreateTargets)
auto t = targets.begin();
ASSERT_EQ((*t)->getPos(), 0);
- ASSERT_EQ((*t)->getPath(), masterDir);
+ ASSERT_EQ((*t)->getCFAMPath(), masterDir);
}
@@ -95,7 +95,7 @@ TEST_F(TargetingTest, CreateTargets)
path << _directory << "/slave@0" << i << ":00/raw";
}
- ASSERT_EQ(t->getPath(), path.str());
+ ASSERT_EQ(t->getCFAMPath(), path.str());
i++;
}
}
OpenPOWER on IntegriCloud