proxygen
|
#include <folly/test/DeterministicSchedule.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Classes | |
struct | AnnotatedAtomicCounter< T > |
class | AtomicCounter< T, Atom > |
struct | AuxData |
struct | AuxData::PerThread |
struct | AnnotatedAtomicCounter< T > |
Macros | |
#define | AUX_THR(x) (aux_->t_[tid_].x) |
#define | AUX_UPDATE() (aux_->lastUpdate_ = aux_->step_ + 1) |
#define | AUX_ACT(act) |
Typedefs | |
using | DSched = DeterministicSchedule |
template<typename T > | |
using | Base = AtomicCounter< T, DeterministicAtomic > |
using | Annotated = AnnotatedAtomicCounter< int > |
Functions | |
TEST (DeterministicSchedule, uniform) | |
TEST (DeterministicSchedule, uniformSubset) | |
TEST (DeterministicSchedule, buggyAdd) | |
DEFINE_int64 (seed, 0,"Seed for random number generators") | |
DEFINE_int64 (max_steps, 1000000,"Max. number of shared steps for the test") | |
DEFINE_int64 (num_reps, 1,"Number of test repetitions") | |
DEFINE_int64 (num_ops, 1000,"Number of increments per repetition") | |
DEFINE_int64 (liveness_thresh, 1000000,"Liveness threshold") | |
DEFINE_int64 (log_begin, 0,"Step number to start logging. No logging if <= 0") | |
DEFINE_int64 (log_length, 1000,"Length of step by step log (if log_begin > 0)") | |
DEFINE_int64 (log_freq, 100000,"Log every so many steps") | |
DEFINE_int32 (num_threads, 1,"Number of producers") | |
DEFINE_bool (bug, false,"Introduce bug") | |
TEST (DeterministicSchedule, global_invariants) | |
int | main (int argc, char **argv) |
Variables | |
static AuxData * | aux_ |
static FOLLY_TLS uint32_t | tid_ |
#define AUX_ACT | ( | act | ) |
Macro for inline definition of auxiliary actions
Definition at line 238 of file DeterministicScheduleTest.cpp.
Referenced by AnnotatedAtomicCounter< T >::inc(), and AnnotatedAtomicCounter< T >::incBug().
Aux macros
Definition at line 234 of file DeterministicScheduleTest.cpp.
Referenced by AnnotatedAtomicCounter< T >::doAuxLog(), AnnotatedAtomicCounter< T >::inc(), and AnnotatedAtomicCounter< T >::incBug().
Definition at line 235 of file DeterministicScheduleTest.cpp.
using Annotated = AnnotatedAtomicCounter<int> |
Definition at line 337 of file DeterministicScheduleTest.cpp.
using Base = AtomicCounter<T, DeterministicAtomic> |
Alias for original class
Definition at line 254 of file DeterministicScheduleTest.cpp.
using DSched = DeterministicSchedule |
Definition at line 166 of file DeterministicScheduleTest.cpp.
DEFINE_bool | ( | bug | , |
false | , | ||
"Introduce bug" | |||
) |
DEFINE_int32 | ( | num_threads | , |
1 | , | ||
"Number of producers" | |||
) |
DEFINE_int64 | ( | num_reps | , |
1 | , | ||
"Number of test repetitions" | |||
) |
DEFINE_int64 | ( | num_ops | , |
1000 | , | ||
"Number of increments per repetition" | |||
) |
DEFINE_int64 | ( | liveness_thresh | , |
1000000 | , | ||
"Liveness threshold" | |||
) |
DEFINE_int64 | ( | log_length | , |
1000 | , | ||
"Length of step by step log (if log_begin > 0)" | |||
) |
DEFINE_int64 | ( | log_freq | , |
100000 | , | ||
"Log every so many steps" | |||
) |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 370 of file DeterministicScheduleTest.cpp.
References testing::InitGoogleTest(), and RUN_ALL_TESTS().
TEST | ( | DeterministicSchedule | , |
uniform | |||
) |
Definition at line 24 of file DeterministicScheduleTest.cpp.
References EXPECT_TRUE, i, and folly::test::DeterministicSchedule::uniform().
TEST | ( | DeterministicSchedule | , |
uniformSubset | |||
) |
Definition at line 35 of file DeterministicScheduleTest.cpp.
References EXPECT_EQ, EXPECT_TRUE, i, seen, folly::test::DeterministicSchedule::uniformSubset(), and x.
TEST | ( | DeterministicSchedule | , |
buggyAdd | |||
) |
Definition at line 54 of file DeterministicScheduleTest.cpp.
References EXPECT_EQ, FOLLY_TEST_DSCHED_VLOG, folly::test::DeterministicSchedule::join(), folly::test::DeterministicMutex::lock(), m, folly::pushmi::detail::t, folly::test::DeterministicSchedule::thread(), threads, folly::test::DeterministicMutex::try_lock(), folly::test::DeterministicSchedule::uniform(), and folly::test::DeterministicMutex::unlock().
TEST | ( | DeterministicSchedule | , |
global_invariants | |||
) |
Definition at line 339 of file DeterministicScheduleTest.cpp.
References aux_, AnnotatedAtomicCounter< T >::clearAuxChk(), AnnotatedAtomicCounter< T >::doAuxLog(), EXPECT_EQ, i, AnnotatedAtomicCounter< T >::inc(), AnnotatedAtomicCounter< T >::incBug(), folly::test::DeterministicSchedule::join(), AnnotatedAtomicCounter< T >::loadDirect(), AnnotatedAtomicCounter< T >::setAuxChk(), AuxData::step_, folly::pushmi::detail::t, folly::test::DeterministicSchedule::thread(), threads, tid_, and folly::test::DeterministicSchedule::uniform().
|
static |
Definition at line 218 of file DeterministicScheduleTest.cpp.
Referenced by TEST().
|
static |
Definition at line 219 of file DeterministicScheduleTest.cpp.
Referenced by AnnotatedAtomicCounter< T >::doAuxLog(), folly::TimePoint::reset(), and TEST().