diff options
Diffstat (limited to 'contrib/ntp/tests/libntp/humandate.c')
-rw-r--r-- | contrib/ntp/tests/libntp/humandate.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/contrib/ntp/tests/libntp/humandate.c b/contrib/ntp/tests/libntp/humandate.c index 3a28f59..de3c751 100644 --- a/contrib/ntp/tests/libntp/humandate.c +++ b/contrib/ntp/tests/libntp/humandate.c @@ -5,11 +5,21 @@ #include "unity.h" +void setUp(void); void test_RegularTime(void); void test_CurrentTime(void); void +setUp(void) +{ + init_lib(); + + return; +} + + +void test_RegularTime(void) { time_t sample = 1276601278; @@ -17,11 +27,13 @@ test_RegularTime(void) struct tm* tm; tm = localtime(&sample); - TEST_ASSERT_TRUE(time != NULL); + TEST_ASSERT_TRUE(tm != NULL); snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); TEST_ASSERT_EQUAL_STRING(expected, humantime(sample)); + + return; } void @@ -34,9 +46,11 @@ test_CurrentTime(void) time(&sample); tm = localtime(&sample); - TEST_ASSERT_TRUE(time != NULL); + TEST_ASSERT_TRUE(tm != NULL); snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); TEST_ASSERT_EQUAL_STRING(expected, humantime(sample)); + + return; } |