3 #include "ntp_calendar.h"
4 #include "ntp_stdlib.h"
8 void test_RegularTime(void);
9 void test_CurrentTime(void);
13 test_RegularTime(void)
15 time_t sample = 1276601278;
19 tm = localtime(&sample);
20 TEST_ASSERT_TRUE(time != NULL);
22 snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
24 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
28 test_CurrentTime(void)
36 tm = localtime(&sample);
37 TEST_ASSERT_TRUE(time != NULL);
39 snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
41 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));