From 799cd0410bc2c4180876b96a0c2fc179c6ca114a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 6 May 2015 21:15:07 +0100 Subject: Move sandbox setup/teardown into a global fixture. --- netfs/unittests/testCore.cpp | 21 +++++++++++++++------ 1 file 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 ) { -- cgit v1.2.3