Debian Codegraph @

tests/test_utils.hh

raw
1 #ifndef TEST_UTILS_HH_
2 #define TEST_UTILS_HH_
3
4 #include <vector>
5 #include <cassert>
6 #include <string>
7
8 const char *parse_progname(const char *c);
9 int parse_int(const char *c, int *result);
10 int parse_unsigned(const char *c, unsigned *result);
11 int parse_double(const char *c, double *result);
12 int parse_vector_of_doubles(char **c, int n, std::vector<double>* v);
13
14 double test_rng();
15 std::string random_string(unsigned len);
16
17 // The following returns the time of run (wall clock) of a certain
18 // function in usec/cycle. n cycles are run during the measurement.
19 double time_of_run(void (*fcn)(void), unsigned n);
20
21 #endif // TEST_UTILS_HH_