xref: /netbsd-src/external/bsd/ntp/dist/tests/libntp/run-decodenetnum.c (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1 /*	$NetBSD: run-decodenetnum.c,v 1.4 2022/10/09 21:41:04 christos Exp $	*/
2 
3 /* AUTOGENERATED FILE. DO NOT EDIT. */
4 
5 //=======Test Runner Used To Run Each Test Below=====
6 #define RUN_TEST(TestFunc, TestLineNum) \
7 { \
8   Unity.CurrentTestName = #TestFunc; \
9   Unity.CurrentTestLineNumber = TestLineNum; \
10   Unity.NumberOfTests++; \
11   if (TEST_PROTECT()) \
12   { \
13       setUp(); \
14       TestFunc(); \
15   } \
16   if (TEST_PROTECT() && !TEST_IS_IGNORED) \
17   { \
18     tearDown(); \
19   } \
20   UnityConcludeTest(); \
21 }
22 
23 //=======Automagically Detected Files To Include=====
24 #include "unity.h"
25 #include <setjmp.h>
26 #include <stdio.h>
27 #include "config.h"
28 #include "ntp_stdlib.h"
29 #include "sockaddrtest.h"
30 
31 //=======External Functions This Runner Calls=====
32 extern void setUp(void);
33 extern void tearDown(void);
34 extern void test_IPv4AddressOnly(void);
35 extern void test_IPv4AddressWithPort(void);
36 extern void test_IPv6AddressOnly(void);
37 extern void test_IPv6AddressWithPort(void);
38 extern void test_IPv6AddressWithScope(void);
39 extern void test_IPv6AddressWithPortAndScope(void);
40 extern void test_IllegalAddress(void);
41 extern void test_IllegalCharInPort(void);
42 extern void test_NameBufOverflow(void);
43 
44 
45 //=======Suite Setup=====
46 static void suite_setup(void)
47 {
48 extern int change_iobufs(int);
49 extern int change_logfile(const char*, int);
50 change_iobufs(1);
51 change_logfile("stderr", 0);
52 }
53 
54 //=======Test Reset Option=====
55 void resetTest(void);
56 void resetTest(void)
57 {
58   tearDown();
59   setUp();
60 }
61 
62 char const *progname;
63 
64 
65 //=======MAIN=====
66 int main(int argc, char *argv[])
67 {
68   progname = argv[0];
69   suite_setup();
70   UnityBegin("decodenetnum.c");
71   RUN_TEST(test_IPv4AddressOnly, 8);
72   RUN_TEST(test_IPv4AddressWithPort, 9);
73   RUN_TEST(test_IPv6AddressOnly, 10);
74   RUN_TEST(test_IPv6AddressWithPort, 11);
75   RUN_TEST(test_IPv6AddressWithScope, 12);
76   RUN_TEST(test_IPv6AddressWithPortAndScope, 13);
77   RUN_TEST(test_IllegalAddress, 14);
78   RUN_TEST(test_IllegalCharInPort, 15);
79   RUN_TEST(test_NameBufOverflow, 16);
80 
81   return (UnityEnd());
82 }
83