tests: refactor common test infrastructure and fixtures
Change-Id: I597c11130eefa2cc2846ee6655c85dc04f2f22ef
diff --git a/tests/unit/security/pib/pib-impl.t.cpp b/tests/unit/security/pib/pib-impl.t.cpp
index e16f658..971d995 100644
--- a/tests/unit/security/pib/pib-impl.t.cpp
+++ b/tests/unit/security/pib/pib-impl.t.cpp
@@ -52,20 +52,16 @@
class PibSqlite3Fixture : public PibDataFixture
{
public:
- PibSqlite3Fixture()
- : tmpPath(boost::filesystem::path(UNIT_TEST_CONFIG_PATH) / "DbTest")
- , pib(tmpPath.c_str())
- {
- }
-
~PibSqlite3Fixture()
{
- boost::filesystem::remove_all(tmpPath);
+ boost::filesystem::remove_all(m_path);
}
+private:
+ const boost::filesystem::path m_path{boost::filesystem::path(UNIT_TESTS_TMPDIR) / "TestPibImpl"};
+
public:
- boost::filesystem::path tmpPath;
- PibSqlite3 pib;
+ PibSqlite3 pib{m_path.string()};
};
using PibImpls = boost::mpl::vector<PibMemoryFixture, PibSqlite3Fixture>;