]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/tests/libntp/statestr.c
Upgrade NTP to 4.2.8p4.
[FreeBSD/releng/10.2.git] / contrib / ntp / tests / libntp / statestr.c
1 #include "config.h"
2
3 #include "ntp_stdlib.h"
4 #include "ntp.h" // needed for MAX_MAC_LEN used in ntp_control.h
5 #include "ntp_control.h"
6
7 #include "unity.h"
8
9 void test_PeerRestart(void);
10 void test_SysUnspecified(void);
11 void test_ClockCodeExists(void);
12 void test_ClockCodeUnknown(void);
13
14 // eventstr()
15 void
16 test_PeerRestart(void) {
17         TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART));
18 }
19
20
21 void
22 test_SysUnspecified(void) {
23         TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC));
24 }
25
26
27 // ceventstr()
28 void
29 test_ClockCodeExists(void) {
30         TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY));
31 }
32
33
34 void
35 test_ClockCodeUnknown(void) {
36         TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1));
37 }