Commit 6b66499c authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot 6

various improvements to the Synchronized tests

Summary:
Add a runParallel() helper function, to clean up logic that was copy-and-pasted
through most of the test functions.  Additionally, clean up the tests to avoid
unnecessary sleeps.  Also fix backwards arguments to EXPECT_EQ() calls--gtest
assumes the first argument is the expected value, and the second argument is
the value being checked.

Reviewed By: yfeldblum

Differential Revision: D3521565

fbshipit-source-id: e4f007d52c114080cff1fd7a0a407fba39fa8b0e
parent a2b94586
......@@ -27,7 +27,7 @@
#include <folly/test/SynchronizedTestLib.h>
#include <gtest/gtest.h>
namespace {
using namespace folly::sync_tests;
template <class Mutex>
class SynchronizedTest : public testing::Test {};
......@@ -224,4 +224,3 @@ TEST_F(SynchronizedLockTest, NestedSyncUnSync2) {
}
EXPECT_EQ((CountPair{4, 4}), FakeMutex::getLockUnlockCount());
}
}
This diff is collapsed.
......@@ -28,21 +28,17 @@
//
// ... similar for testConcurrency, testDualLocking, etc.
namespace folly {
namespace sync_tests {
template <class Mutex> void testBasic();
template <class Mutex> void testConcurrency();
template <class Mutex> void testDualLocking();
template <class Mutex> void testDualLockingWithConst();
template <class Mutex> void testTimedSynchronized();
template <class Mutex> void testTimedSynchronizedWithConst();
template <class Mutex> void testConstCopy();
template <class Mutex> void testInPlaceConstruction();
}
}
#include <folly/test/SynchronizedTestLib-inl.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment