diff options
| author | Gertjan van den Burg <burg@ese.eur.nl> | 2016-10-06 17:42:41 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <burg@ese.eur.nl> | 2016-10-06 17:42:41 +0200 |
| commit | af81088cf938f388dac201a90b8ef221ee82aef6 (patch) | |
| tree | 7431e982ce6c89914dda04b4eee61e26cdbd6568 /tests/src/test_gensvm_timer.c | |
| parent | Coding style - set all pointers to NULL initially and after free (diff) | |
| download | gensvm-af81088cf938f388dac201a90b8ef221ee82aef6.tar.gz gensvm-af81088cf938f388dac201a90b8ef221ee82aef6.zip | |
change timer functionality to use clock_monotonic_raw
Diffstat (limited to 'tests/src/test_gensvm_timer.c')
| -rw-r--r-- | tests/src/test_gensvm_timer.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/src/test_gensvm_timer.c b/tests/src/test_gensvm_timer.c new file mode 100644 index 0000000..78e968f --- /dev/null +++ b/tests/src/test_gensvm_timer.c @@ -0,0 +1,34 @@ +/** + * @file test_gensvm_timer.c + * @author Gertjan van den Burg + * @date October, 2016 + * @brief Unit tests for gensvm_timer.c functions + * + */ + +#include "minunit.h" +#include "gensvm_timer.h" + +char *test_timer() +{ + struct timespec start, stop; + Timer(start); + + stop.tv_sec = start.tv_sec + 1; + stop.tv_nsec = start.tv_nsec; + + mu_assert(gensvm_elapsed_time(&start, &stop) == 1.0, + "Incorrect time computed"); + + return NULL; +} + +char *all_tests() +{ + mu_suite_start(); + mu_run_test(test_timer); + + return NULL; +} + +RUN_TESTS(all_tests); |
