67 void setSeed (
unsigned int seed = time ( NULL ) );
74 int random (
int max )
const;
80 uint64_t
random ( uint64_t max )
const;
86 double random (
double max = 1.0 )
const;
117 std::vector<std::vector<std::chrono::high_resolution_clock::time_point> >
timeMeasures;
124 #ifdef CAN_IGNORE_WARNINGS
125 #define STRINGIFY(a) #a
126 #define IGNORE_WARNING(warning) _Pragma(STRINGIFY(GCC diagnostic ignored #warning))
127 #define IGNORE_TEST_WARNINGS IGNORE_WARNING(-Wunknown-pragmas); \
128 IGNORE_WARNING(-Wunused-variable); \
129 IGNORE_WARNING(-Wdeprecated-declarations); \
130 IGNORE_WARNING(-Wsign-compare); \
131 IGNORE_WARNING(-Wunused-but-set-variable)
132 #define RESTORE_WARNING _Pragma("GCC diagnostic pop")
133 #define RESTORE_WARNINGS RESTORE_WARNING; RESTORE_WARNING; RESTORE_WARNING; RESTORE_WARNING; RESTORE_WARNING;
135 #define IGNORE_WARNING(warning)
136 #define IGNORE_TEST_WARNINGS
137 #define RESTORE_WARNING
138 #define RESTORE_WARNINGS
void addTimeMeasurement()
Saves the current timestamp.
void addComment(const char *comment)
Simple setter.
void addExternalTime(std::chrono::duration< double >)
Add a duration to the timing list.
tester(const char *name="")
tester Create a new tester
void startNewRNGCycle()
Starts a new cycle of random numbers.
void setSeed(unsigned int seed=time(NULL))
Set a new seed for random number generation.
int random(int max) const
Get a random number (integer)
void startNewTimeCycle()
Starts a new cycle of time measurements.
std::vector< int64_t > getDurationsForCurrentCycle() const
Take the current cycle of time measurements and calculate all durations in betwen.
std::vector< unsigned int > seeds
A basic class to be used by tests. Provides helper methods and functionality e.g. time measurements...
std::vector< std::vector< std::chrono::high_resolution_clock::time_point > > timeMeasures
void writeToFile()
Write all collected information to file.
~tester()
Cleans up and destroys the tester.
std::vector< bool > seeded
void addParameter(char *param)
Add a new parameter to the list of parameters.
std::vector< char * > parameters