diff options
-rw-r--r-- | netfs/unittests/testEdgeCases.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/netfs/unittests/testEdgeCases.cpp b/netfs/unittests/testEdgeCases.cpp index 01eb6b7..28e0f4c 100644 --- a/netfs/unittests/testEdgeCases.cpp +++ b/netfs/unittests/testEdgeCases.cpp @@ -89,10 +89,10 @@ BOOST_AUTO_TEST_CASE(manyThreads) MockDaemonHost daemon(testEndpoint, {"--NetFSD.ConfigPath=" + (rootDir / "defaultDaemon.xml").string()}); FuseMockHost fuse(testEndpoint, {(rootDir / "defaultFuse.xml:testvol").string(), (rootDir / "test").string()}); - bool running = true; + std::atomic<bool> running {true}; std::vector<std::thread> ths; ths.reserve(20); - std::atomic_uint success = 0; + std::atomic<unsigned int> success {0}, failure {0}; for (int x = 0; x < 20; x++) { ths.emplace_back([&] { struct statvfs s { @@ -101,8 +101,11 @@ BOOST_AUTO_TEST_CASE(manyThreads) if (fuse.fuse->statfs("/", &s) == 0) { success++; } + else { + failure++; + } + usleep(10000); } - usleep(10000); }); } @@ -116,4 +119,5 @@ BOOST_AUTO_TEST_CASE(manyThreads) } BOOST_CHECK_GT(success, 800); + BOOST_CHECK_EQUAL(failure, 0); } |