3 #include "ntp_calendar.h"
4 #include "ntp_stdlib.h"
9 void test_RegularTime(void);
10 void test_CurrentTime(void);
23 test_RegularTime(void)
25 time_t sample = 1276601278;
29 tm = localtime(&sample);
30 TEST_ASSERT_TRUE(tm != NULL);
32 snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
34 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
40 test_CurrentTime(void)
48 tm = localtime(&sample);
49 TEST_ASSERT_TRUE(tm != NULL);
51 snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
53 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));