GenSVM
test_gensvm_timer.c
Go to the documentation of this file.
1 
27 #include "minunit.h"
28 #include "gensvm_timer.h"
29 
30 char *test_timer()
31 {
32  struct timespec start, stop;
33  Timer(start);
34 
35  stop.tv_sec = start.tv_sec + 1;
36  stop.tv_nsec = start.tv_nsec;
37 
38  mu_assert(gensvm_elapsed_time(&start, &stop) == 1.0,
39  "Incorrect time computed");
40 
41  return NULL;
42 }
43 
44 char *all_tests()
45 {
48 
49  return NULL;
50 }
51 
Minimal unit testing framework for C.
double gensvm_elapsed_time(struct timespec *start, struct timespec *stop)
Calculate the time between two time recordings.
Definition: gensvm_timer.c:58
RUN_TESTS(all_tests)
#define mu_assert(test, message)
Definition: minunit.h:29
char * all_tests()
#define mu_run_test(test)
Definition: minunit.h:35
Header file for gensvm_timer.c.
char * test_timer()
#define mu_suite_start()
Definition: minunit.h:24
#define Timer(spec)
Timer macro for easily recording time.
Definition: gensvm_timer.h:37