1/*	$NetBSD: statestr.c,v 1.2 2020/05/25 20:47:36 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
11void setUp(void);
12void test_PeerRestart(void);
13void test_SysUnspecified(void);
14void test_ClockCodeExists(void);
15void test_ClockCodeUnknown(void);
16
17
18void
19setUp(void)
20{
21	init_lib();
22
23	return;
24}
25
26
27// eventstr()
28void
29test_PeerRestart(void) {
30	TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART));
31}
32
33
34void
35test_SysUnspecified(void) {
36	TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC));
37}
38
39
40// ceventstr()
41void
42test_ClockCodeExists(void) {
43	TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY));
44}
45
46
47void
48test_ClockCodeUnknown(void) {
49	TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1));
50}
51