summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-05-06 21:15:07 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-05-06 21:15:07 +0100
commit799cd0410bc2c4180876b96a0c2fc179c6ca114a (patch)
tree2b686648de5dfe871968e39eaccc64a1df6dba1b
parentMerge branch 'netfs-test-refactor' of randomdan.homeip.net:/var/git/src into ... (diff)
downloadnetfs-799cd0410bc2c4180876b96a0c2fc179c6ca114a.tar.bz2
netfs-799cd0410bc2c4180876b96a0c2fc179c6ca114a.tar.xz
netfs-799cd0410bc2c4180876b96a0c2fc179c6ca114a.zip
Move sandbox setup/teardown into a global fixture.
-rw-r--r--netfs/unittests/testCore.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index ba330cd..1fc1817 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -144,13 +144,22 @@ class Core {
fuse_operations * fuse;;
};
-BOOST_FIXTURE_TEST_SUITE( NetfsCore, Core )
+class GlobalSandBox {
+ public:
+ GlobalSandBox()
+ {
+ boost::filesystem::remove_all(TestExportRoot);
+ boost::filesystem::create_directories(TestExportRoot);
+ }
+ ~GlobalSandBox()
+ {
+ boost::filesystem::remove_all(TestExportRoot);
+ }
+};
-BOOST_AUTO_TEST_CASE ( initializeSandbox )
-{
- boost::filesystem::remove_all(TestExportRoot);
- boost::filesystem::create_directories(TestExportRoot);
-}
+BOOST_GLOBAL_FIXTURE(GlobalSandBox);
+
+BOOST_FIXTURE_TEST_SUITE( NetfsCore, Core )
BOOST_AUTO_TEST_CASE ( daemonInitialised )
{