aboutsummaryrefslogtreecommitdiff
path: root/tests/src/test_gensvm_timer.c
blob: 78e968f48ce4589d28c2b60087f040fe00dab96e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);