diff options
Diffstat (limited to 'tests/libntp/statestr.c')
-rw-r--r-- | tests/libntp/statestr.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/libntp/statestr.c b/tests/libntp/statestr.c new file mode 100644 index 0000000000000..5f7babe4537b6 --- /dev/null +++ b/tests/libntp/statestr.c @@ -0,0 +1,36 @@ +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" +#include "ntp.h" // Needed for MAX_MAC_LEN used in ntp_control.h +#include "ntp_control.h" + +#include "unity.h" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + + +// eventstr() +void test_PeerRestart(void) { + TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART)); +} + +void test_SysUnspecified(void) { + TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC)); +} + +// ceventstr() +void test_ClockCodeExists(void) { + TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY)); +} + +void test_ClockCodeUnknown(void) { + TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1)); +} + |