aboutsummaryrefslogtreecommitdiff
path: root/tests/src/test_gensvm_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/test_gensvm_timer.c')
-rw-r--r--tests/src/test_gensvm_timer.c34
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);