Commit e1b1233a authored by Doron Roberts-Kedes's avatar Doron Roberts-Kedes Committed by Facebook Github Bot

BatonTest: initialize a DeterministicSchedule for tests using DeterministicAtomics

Summary: Using DeterministicAtomic without initializing a DeterministicSchedule doesn't offer determinism, and at the time of the last commit to this test, DeterministicAtomics did not even have atomic operations without a DeterministicSchedule. Initializing a DeterministicSchedule for these tests adds determinism and atomicity to the current DeterministicAtomics. This is will be required once to support atomic history buffers in the future.

Reviewed By: davidtgoldblatt

Differential Revision: D10478718

fbshipit-source-id: f03629ab8683c05eff41eb4886d23d00d42615e8
parent 1bab1e54
......@@ -73,12 +73,14 @@ TEST(Baton, timed_wait_basic_system_clock_nonblocking) {
// Timed wait timeout system clock tests
TEST(Baton, timed_wait_timeout_system_clock_blocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_tmo_tests<true, std::atomic, system_clock>();
run_timed_wait_tmo_tests<true, EmulatedFutexAtomic, system_clock>();
run_timed_wait_tmo_tests<true, DeterministicAtomic, system_clock>();
}
TEST(Baton, timed_wait_timeout_system_clock_nonblocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_tmo_tests<false, std::atomic, system_clock>();
run_timed_wait_tmo_tests<false, EmulatedFutexAtomic, system_clock>();
run_timed_wait_tmo_tests<false, DeterministicAtomic, system_clock>();
......@@ -87,12 +89,14 @@ TEST(Baton, timed_wait_timeout_system_clock_nonblocking) {
// Timed wait regular system clock tests
TEST(Baton, timed_wait_system_clock_blocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_regular_test<true, std::atomic, system_clock>();
run_timed_wait_regular_test<true, EmulatedFutexAtomic, system_clock>();
run_timed_wait_regular_test<true, DeterministicAtomic, system_clock>();
}
TEST(Baton, timed_wait_system_clock_nonblocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_regular_test<false, std::atomic, system_clock>();
run_timed_wait_regular_test<false, EmulatedFutexAtomic, system_clock>();
run_timed_wait_regular_test<false, DeterministicAtomic, system_clock>();
......@@ -101,12 +105,14 @@ TEST(Baton, timed_wait_system_clock_nonblocking) {
// Timed wait basic steady clock tests
TEST(Baton, timed_wait_basic_steady_clock_blocking) {
DSched sched(DSched::uniform(0));
run_basic_timed_wait_tests<true, std::atomic, steady_clock>();
run_basic_timed_wait_tests<true, EmulatedFutexAtomic, steady_clock>();
run_basic_timed_wait_tests<true, DeterministicAtomic, steady_clock>();
}
TEST(Baton, timed_wait_basic_steady_clock_nonblocking) {
DSched sched(DSched::uniform(0));
run_basic_timed_wait_tests<false, std::atomic, steady_clock>();
run_basic_timed_wait_tests<false, EmulatedFutexAtomic, steady_clock>();
run_basic_timed_wait_tests<false, DeterministicAtomic, steady_clock>();
......@@ -115,12 +121,14 @@ TEST(Baton, timed_wait_basic_steady_clock_nonblocking) {
// Timed wait timeout steady clock tests
TEST(Baton, timed_wait_timeout_steady_clock_blocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_tmo_tests<true, std::atomic, steady_clock>();
run_timed_wait_tmo_tests<true, EmulatedFutexAtomic, steady_clock>();
run_timed_wait_tmo_tests<true, DeterministicAtomic, steady_clock>();
}
TEST(Baton, timed_wait_timeout_steady_clock_nonblocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_tmo_tests<false, std::atomic, steady_clock>();
run_timed_wait_tmo_tests<false, EmulatedFutexAtomic, steady_clock>();
run_timed_wait_tmo_tests<false, DeterministicAtomic, steady_clock>();
......@@ -129,12 +137,14 @@ TEST(Baton, timed_wait_timeout_steady_clock_nonblocking) {
// Timed wait regular steady clock tests
TEST(Baton, timed_wait_steady_clock_blocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_regular_test<true, std::atomic, steady_clock>();
run_timed_wait_regular_test<true, EmulatedFutexAtomic, steady_clock>();
run_timed_wait_regular_test<true, DeterministicAtomic, steady_clock>();
}
TEST(Baton, timed_wait_steady_clock_nonblocking) {
DSched sched(DSched::uniform(0));
run_timed_wait_regular_test<false, std::atomic, steady_clock>();
run_timed_wait_regular_test<false, EmulatedFutexAtomic, steady_clock>();
run_timed_wait_regular_test<false, DeterministicAtomic, steady_clock>();
......
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