xref: /freebsd/contrib/ntp/sntp/tests/run-keyFile.c (revision e43d33d286a1aa41b6fc6a209f28a18e8cd7437a)
1276da39aSCy Schubert /* AUTOGENERATED FILE. DO NOT EDIT. */
2276da39aSCy Schubert 
3276da39aSCy Schubert //=======Test Runner Used To Run Each Test Below=====
4276da39aSCy Schubert #define RUN_TEST(TestFunc, TestLineNum) \
5276da39aSCy Schubert { \
6276da39aSCy Schubert   Unity.CurrentTestName = #TestFunc; \
7276da39aSCy Schubert   Unity.CurrentTestLineNumber = TestLineNum; \
8276da39aSCy Schubert   Unity.NumberOfTests++; \
9276da39aSCy Schubert   if (TEST_PROTECT()) \
10276da39aSCy Schubert   { \
11276da39aSCy Schubert       setUp(); \
12276da39aSCy Schubert       TestFunc(); \
13276da39aSCy Schubert   } \
14276da39aSCy Schubert   if (TEST_PROTECT() && !TEST_IS_IGNORED) \
15276da39aSCy Schubert   { \
16276da39aSCy Schubert     tearDown(); \
17276da39aSCy Schubert   } \
18276da39aSCy Schubert   UnityConcludeTest(); \
19276da39aSCy Schubert }
20276da39aSCy Schubert 
21276da39aSCy Schubert //=======Automagically Detected Files To Include=====
22276da39aSCy Schubert #include "unity.h"
23276da39aSCy Schubert #include <setjmp.h>
24276da39aSCy Schubert #include <stdio.h>
259034852cSGleb Smirnoff #include "config.h"
269034852cSGleb Smirnoff #include "fileHandlingTest.h"
279034852cSGleb Smirnoff #include "ntp_stdlib.h"
289034852cSGleb Smirnoff #include "ntp_types.h"
299034852cSGleb Smirnoff #include "crypto.h"
30276da39aSCy Schubert 
31276da39aSCy Schubert //=======External Functions This Runner Calls=====
32276da39aSCy Schubert extern void setUp(void);
33276da39aSCy Schubert extern void tearDown(void);
349034852cSGleb Smirnoff extern void test_ReadEmptyKeyFile(void);
359034852cSGleb Smirnoff extern void test_ReadASCIIKeys(void);
369034852cSGleb Smirnoff extern void test_ReadHexKeys(void);
379034852cSGleb Smirnoff extern void test_ReadKeyFileWithComments(void);
389034852cSGleb Smirnoff extern void test_ReadKeyFileWithInvalidHex(void);
39276da39aSCy Schubert 
40276da39aSCy Schubert 
4109100258SXin LI //=======Suite Setup=====
suite_setup(void)4209100258SXin LI static void suite_setup(void)
4309100258SXin LI {
44*2d4e511cSCy Schubert extern int change_iobufs(int);
4509100258SXin LI extern int change_logfile(const char*, int);
46*2d4e511cSCy Schubert change_iobufs(1);
4709100258SXin LI change_logfile("stderr", 0);
4809100258SXin LI }
4909100258SXin LI 
50276da39aSCy Schubert //=======Test Reset Option=====
519034852cSGleb Smirnoff void resetTest(void);
resetTest(void)529034852cSGleb Smirnoff void resetTest(void)
53276da39aSCy Schubert {
54276da39aSCy Schubert   tearDown();
55276da39aSCy Schubert   setUp();
56276da39aSCy Schubert }
57276da39aSCy Schubert 
589034852cSGleb Smirnoff char const *progname;
59276da39aSCy Schubert 
60276da39aSCy Schubert 
61276da39aSCy Schubert //=======MAIN=====
main(int argc,char * argv[])62276da39aSCy Schubert int main(int argc, char *argv[])
63276da39aSCy Schubert {
64276da39aSCy Schubert   progname = argv[0];
6509100258SXin LI   suite_setup();
66276da39aSCy Schubert   UnityBegin("keyFile.c");
679034852cSGleb Smirnoff   RUN_TEST(test_ReadEmptyKeyFile, 12);
689034852cSGleb Smirnoff   RUN_TEST(test_ReadASCIIKeys, 13);
699034852cSGleb Smirnoff   RUN_TEST(test_ReadHexKeys, 14);
709034852cSGleb Smirnoff   RUN_TEST(test_ReadKeyFileWithComments, 15);
719034852cSGleb Smirnoff   RUN_TEST(test_ReadKeyFileWithInvalidHex, 16);
72276da39aSCy Schubert 
73276da39aSCy Schubert   return (UnityEnd());
74276da39aSCy Schubert }
75