Showing the changes to test/timer.c (1 of 3 files). Show all
Unified · Split
| @@ -1,7 +1,6 @@ | |||
| 1 | #include "common/common.h" | 1 | #include "common/common.h" |
| 2 | #include "osdep/timer.h" | 2 | #include "osdep/timer.h" |
| 3 | #include "test_utils.h" | 3 | #include "test_utils.h" |
| 4 | #include "config.h" | ||
| 5 | 4 | ||
| 6 | #include <time.h> | 5 | #include <time.h> |
| 7 | #include <sys/time.h> | 6 | #include <sys/time.h> |
| @@ -38,20 +37,5 @@ int main(void) · 30 unmodified lines | |||
| 38 | assert_int_equal(mp_time_ns_add(test2, 20.44), INT64_MAX); | 37 | assert_int_equal(mp_time_ns_add(test2, 20.44), INT64_MAX); |
| 39 | } | 38 | } |
| 40 | 39 | ||
| 41 | #if !HAVE_WIN32_THREADS | ||
| 42 | /* conversion */ | ||
| 43 | { | ||
| 44 | struct timeval tv; | ||
| 45 | struct timespec ts; | ||
| 46 | gettimeofday(&tv, NULL); | ||
| 47 | ts = mp_time_ns_to_realtime(mp_time_ns()); | ||
| 48 | assert_true(llabs(tv.tv_sec - ts.tv_sec) <= 1); | ||
| 49 | |||
| 50 | gettimeofday(&tv, NULL); | ||
| 51 | ts = mp_rel_time_to_timespec(0.0); | ||
| 52 | assert_true(llabs(tv.tv_sec - ts.tv_sec) <= 1); | ||
| 53 | } | ||
| 54 | #endif | ||
| 55 | |||
| 56 | return 0; | 40 | return 0; |
| 57 | } | 41 | } |