xref: /freebsd/contrib/ntp/sntp/tests/run-packetProcessing.c (revision cdebaff820b2a4915a16cedfd511823d78aab171)
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 "sntptest.h"
27 #include "networking.h"
28 #include "ntp_stdlib.h"
29 
30 //=======External Functions This Runner Calls=====
31 extern void setUp(void);
32 extern void tearDown(void);
33 extern void test_TooShortLength(void);
34 extern void test_LengthNotMultipleOfFour(void);
35 extern void test_TooShortExtensionFieldLength(void);
36 extern void test_UnauthenticatedPacketReject(void);
37 extern void test_CryptoNAKPacketReject(void);
38 extern void test_AuthenticatedPacketInvalid(void);
39 extern void test_AuthenticatedPacketUnknownKey(void);
40 extern void test_ServerVersionTooOld(void);
41 extern void test_ServerVersionTooNew(void);
42 extern void test_NonWantedMode(void);
43 extern void test_KoDRate(void);
44 extern void test_KoDDeny(void);
45 extern void test_RejectUnsyncedServer(void);
46 extern void test_RejectWrongResponseServerMode(void);
47 extern void test_AcceptNoSentPacketBroadcastMode(void);
48 extern void test_CorrectUnauthenticatedPacket(void);
49 extern void test_CorrectAuthenticatedPacketMD5(void);
50 extern void test_CorrectAuthenticatedPacketSHA1(void);
51 
52 
53 //=======Test Reset Option=====
54 void resetTest(void);
55 void resetTest(void)
56 {
57   tearDown();
58   setUp();
59 }
60 
61 char const *progname;
62 
63 
64 //=======MAIN=====
65 int main(int argc, char *argv[])
66 {
67   progname = argv[0];
68   UnityBegin("packetProcessing.c");
69   RUN_TEST(test_TooShortLength, 20);
70   RUN_TEST(test_LengthNotMultipleOfFour, 21);
71   RUN_TEST(test_TooShortExtensionFieldLength, 22);
72   RUN_TEST(test_UnauthenticatedPacketReject, 23);
73   RUN_TEST(test_CryptoNAKPacketReject, 24);
74   RUN_TEST(test_AuthenticatedPacketInvalid, 25);
75   RUN_TEST(test_AuthenticatedPacketUnknownKey, 26);
76   RUN_TEST(test_ServerVersionTooOld, 27);
77   RUN_TEST(test_ServerVersionTooNew, 28);
78   RUN_TEST(test_NonWantedMode, 29);
79   RUN_TEST(test_KoDRate, 30);
80   RUN_TEST(test_KoDDeny, 31);
81   RUN_TEST(test_RejectUnsyncedServer, 32);
82   RUN_TEST(test_RejectWrongResponseServerMode, 33);
83   RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 34);
84   RUN_TEST(test_CorrectUnauthenticatedPacket, 35);
85   RUN_TEST(test_CorrectAuthenticatedPacketMD5, 36);
86   RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 37);
87 
88   return (UnityEnd());
89 }
90