xref: /freebsd/contrib/ntp/sntp/tests/run-packetHandling.c (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
1 /* AUTOGENERATED FILE. DO NOT EDIT. */
2 
3 //=======Test Runner Used To Run Each Test Below=====
4 #define RUN_TEST(TestFunc, TestLineNum) \
5 { \
6   Unity.CurrentTestName = #TestFunc; \
7   Unity.CurrentTestLineNumber = TestLineNum; \
8   Unity.NumberOfTests++; \
9   if (TEST_PROTECT()) \
10   { \
11       setUp(); \
12       TestFunc(); \
13   } \
14   if (TEST_PROTECT() && !TEST_IS_IGNORED) \
15   { \
16     tearDown(); \
17   } \
18   UnityConcludeTest(); \
19 }
20 
21 //=======Automagically Detected Files To Include=====
22 #include "unity.h"
23 #include <setjmp.h>
24 #include <stdio.h>
25 #include "config.h"
26 #include "ntp_debug.h"
27 #include "ntp_stdlib.h"
28 #include "ntp_types.h"
29 #include "sntptest.h"
30 #include "kod_management.h"
31 #include "main.h"
32 #include "networking.h"
33 #include "ntp.h"
34 
35 //=======External Functions This Runner Calls=====
36 extern void setUp(void);
37 extern void tearDown(void);
38 extern void test_GenerateUnauthenticatedPacket(void);
39 extern void test_GenerateAuthenticatedPacket(void);
40 extern void test_OffsetCalculationPositiveOffset(void);
41 extern void test_OffsetCalculationNegativeOffset(void);
42 extern void test_HandleUnusableServer(void);
43 extern void test_HandleUnusablePacket(void);
44 extern void test_HandleServerAuthenticationFailure(void);
45 extern void test_HandleKodDemobilize(void);
46 extern void test_HandleKodRate(void);
47 extern void test_HandleCorrectPacket(void);
48 
49 
50 //=======Suite Setup=====
51 static void suite_setup(void)
52 {
53 extern int change_logfile(const char*, int);
54 change_logfile("stderr", 0);
55 }
56 
57 //=======Test Reset Option=====
58 void resetTest(void);
59 void resetTest(void)
60 {
61   tearDown();
62   setUp();
63 }
64 
65 char const *progname;
66 
67 
68 //=======MAIN=====
69 int main(int argc, char *argv[])
70 {
71   progname = argv[0];
72   suite_setup();
73   UnityBegin("packetHandling.c");
74   RUN_TEST(test_GenerateUnauthenticatedPacket, 17);
75   RUN_TEST(test_GenerateAuthenticatedPacket, 18);
76   RUN_TEST(test_OffsetCalculationPositiveOffset, 19);
77   RUN_TEST(test_OffsetCalculationNegativeOffset, 20);
78   RUN_TEST(test_HandleUnusableServer, 21);
79   RUN_TEST(test_HandleUnusablePacket, 22);
80   RUN_TEST(test_HandleServerAuthenticationFailure, 23);
81   RUN_TEST(test_HandleKodDemobilize, 24);
82   RUN_TEST(test_HandleKodRate, 25);
83   RUN_TEST(test_HandleCorrectPacket, 26);
84 
85   return (UnityEnd());
86 }
87