diff --git a/impl/Profiler.h b/impl/Profiler.h index 68a20c0f..b5f8ec72 100644 --- a/impl/Profiler.h +++ b/impl/Profiler.h @@ -4,6 +4,7 @@ #include #include +#include namespace fspp { class Profiler { @@ -14,6 +15,8 @@ namespace fspp { private: std::atomic_uint_fast64_t *_targetForAddingNanosec; std::chrono::high_resolution_clock::time_point _beginTime; + + DISALLOW_COPY_AND_ASSIGN(Profiler); }; inline Profiler::Profiler(std::atomic_uint_fast64_t *targetForAddingNanosec) diff --git a/test/fuse/closeFile/FuseCloseTest.cpp b/test/fuse/closeFile/FuseCloseTest.cpp index 38daa5dc..4fa62cec 100644 --- a/test/fuse/closeFile/FuseCloseTest.cpp +++ b/test/fuse/closeFile/FuseCloseTest.cpp @@ -31,6 +31,8 @@ using std::chrono::seconds; class Barrier { public: + Barrier(): m(), cv(), finished(false) {} + template void WaitAtMost(const duration &atMost) { unique_lock lock(m); @@ -47,7 +49,7 @@ public: private: mutex m; condition_variable cv; - bool finished = false; + bool finished; }; class FuseCloseTest: public FuseTest, public WithParamInterface { diff --git a/test/impl/FuseOpenFileListTest.cpp b/test/impl/FuseOpenFileListTest.cpp index 20be1ebd..c5c5a08b 100644 --- a/test/impl/FuseOpenFileListTest.cpp +++ b/test/impl/FuseOpenFileListTest.cpp @@ -27,14 +27,17 @@ public: }; struct FuseOpenFileListTest: public ::testing::Test { - const int FILEID1 = 4; - const int FLAGS1 = 5; - const int FILEID2 = 6; - const int FLAGS2 = 7; - const int FILEID3 = 8; - const int FLAGS3 = 9; + static constexpr int FILEID1 = 4; + static constexpr int FLAGS1 = 5; + static constexpr int FILEID2 = 6; + static constexpr int FLAGS2 = 7; + static constexpr int FILEID3 = 8; + static constexpr int FLAGS3 = 9; + + FuseOpenFileListTest(): list() {} FuseOpenFileList list; + int open(int fileid, int flags) { return list.open(make_unique_ref(fileid, flags)); } diff --git a/test/impl/IdListTest.cpp b/test/impl/IdListTest.cpp index 5e68e89a..a046904a 100644 --- a/test/impl/IdListTest.cpp +++ b/test/impl/IdListTest.cpp @@ -14,11 +14,14 @@ public: }; struct IdListTest: public ::testing::Test { - const int OBJ1 = 3; - const int OBJ2 = 10; - const int OBJ3 = 8; + static constexpr int OBJ1 = 3; + static constexpr int OBJ2 = 10; + static constexpr int OBJ3 = 8; + + IdListTest(): list() {} IdList list; + int add(int num) { return list.add(make_unique_ref(num)); } diff --git a/test/testutils/FuseTest.h b/test/testutils/FuseTest.h index 19f28237..c472cfe1 100644 --- a/test/testutils/FuseTest.h +++ b/test/testutils/FuseTest.h @@ -84,7 +84,7 @@ public: class FuseTest: public ::testing::Test { public: - const char* FILENAME = "/myfile"; + static constexpr const char* FILENAME = "/myfile"; FuseTest(); diff --git a/test/testutils/FuseThread.cpp b/test/testutils/FuseThread.cpp index a7f3df53..bca5a907 100644 --- a/test/testutils/FuseThread.cpp +++ b/test/testutils/FuseThread.cpp @@ -12,7 +12,7 @@ using std::string; using fspp::fuse::Fuse; FuseThread::FuseThread(Fuse *fuse) - :_fuse(fuse) { + :_fuse(fuse), _child() { } void FuseThread::start(int argc, char *argv[]) { diff --git a/test/testutils/FuseThread.h b/test/testutils/FuseThread.h index d6891c6e..b180e65f 100644 --- a/test/testutils/FuseThread.h +++ b/test/testutils/FuseThread.h @@ -3,6 +3,7 @@ #define MESSMER_FSPP_TEST_TESTUTILS_FUSETHREAD_H_ #include +#include namespace fspp { namespace fuse { @@ -19,6 +20,8 @@ public: private: fspp::fuse::Fuse *_fuse; std::thread _child; + + DISALLOW_COPY_AND_ASSIGN(FuseThread); }; #endif