3 #include "ntp_calendar.h"
4 #include "ntp_stdlib.h"
8 void test_RegularTime(void)
10 time_t sample = 1276601278;
14 time = localtime(&sample);
15 TEST_ASSERT_TRUE(time != NULL);
17 snprintf(expected, 15, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
19 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
22 void test_CurrentTime(void)
30 time = localtime(&sample);
31 TEST_ASSERT_TRUE(time != NULL);
33 snprintf(expected, 15, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
35 TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));