xref: /netbsd-src/external/bsd/ntp/dist/sntp/tests/run-keyFile.c (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: run-keyFile.c,v 1.3 2020/05/25 20:47:35 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 "fileHandlingTest.h"
29 #include "ntp_stdlib.h"
30 #include "ntp_types.h"
31 #include "crypto.h"
32 
33 //=======External Functions This Runner Calls=====
34 extern void setUp(void);
35 extern void tearDown(void);
36 extern void test_ReadEmptyKeyFile(void);
37 extern void test_ReadASCIIKeys(void);
38 extern void test_ReadHexKeys(void);
39 extern void test_ReadKeyFileWithComments(void);
40 extern void test_ReadKeyFileWithInvalidHex(void);
41 
42 
43 //=======Suite Setup=====
suite_setup(void)44 static void suite_setup(void)
45 {
46 extern int change_iobufs(int);
47 extern int change_logfile(const char*, int);
48 change_iobufs(1);
49 change_logfile("stderr", 0);
50 }
51 
52 //=======Test Reset Option=====
53 void resetTest(void);
resetTest(void)54 void resetTest(void)
55 {
56   tearDown();
57   setUp();
58 }
59 
60 char const *progname;
61 
62 
63 //=======MAIN=====
main(int argc,char * argv[])64 int main(int argc, char *argv[])
65 {
66   progname = argv[0];
67   suite_setup();
68   UnityBegin("keyFile.c");
69   RUN_TEST(test_ReadEmptyKeyFile, 12);
70   RUN_TEST(test_ReadASCIIKeys, 13);
71   RUN_TEST(test_ReadHexKeys, 14);
72   RUN_TEST(test_ReadKeyFileWithComments, 15);
73   RUN_TEST(test_ReadKeyFileWithInvalidHex, 16);
74 
75   return (UnityEnd());
76 }
77