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>
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 @@
$(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 @@
auto t = targets.begin();
ASSERT_EQ((*t)->getPos(), 0);
- ASSERT_EQ((*t)->getPath(), masterDir);
+ ASSERT_EQ((*t)->getCFAMPath(), masterDir);
}
@@ -95,7 +95,7 @@
path << _directory << "/slave@0" << i << ":00/raw";
}
- ASSERT_EQ(t->getPath(), path.str());
+ ASSERT_EQ(t->getCFAMPath(), path.str());
i++;
}
}