xref: /netbsd-src/external/bsd/ntp/dist/tests/libntp/statestr.c (revision a6f3f22f245acb8ee3bbf6871d7dce989204fa97)
1 /*	$NetBSD: statestr.c,v 1.1.1.3 2015/10/23 17:47:45 christos Exp $	*/
2 
3 #include "config.h"
4 
5 #include "ntp_stdlib.h"
6 #include "ntp.h" // needed for MAX_MAC_LEN used in ntp_control.h
7 #include "ntp_control.h"
8 
9 #include "unity.h"
10 
11 void test_PeerRestart(void);
12 void test_SysUnspecified(void);
13 void test_ClockCodeExists(void);
14 void test_ClockCodeUnknown(void);
15 
16 // eventstr()
17 void
18 test_PeerRestart(void) {
19 	TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART));
20 }
21 
22 
23 void
24 test_SysUnspecified(void) {
25 	TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC));
26 }
27 
28 
29 // ceventstr()
30 void
31 test_ClockCodeExists(void) {
32 	TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY));
33 }
34 
35 
36 void
37 test_ClockCodeUnknown(void) {
38 	TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1));
39 }
40