xref: /freebsd-src/contrib/ntp/sntp/tests/run-t-log.c (revision e43d33d286a1aa41b6fc6a209f28a18e8cd7437a)
19034852cSGleb Smirnoff /* AUTOGENERATED FILE. DO NOT EDIT. */
29034852cSGleb Smirnoff 
39034852cSGleb Smirnoff //=======Test Runner Used To Run Each Test Below=====
49034852cSGleb Smirnoff #define RUN_TEST(TestFunc, TestLineNum) \
59034852cSGleb Smirnoff { \
69034852cSGleb Smirnoff   Unity.CurrentTestName = #TestFunc; \
79034852cSGleb Smirnoff   Unity.CurrentTestLineNumber = TestLineNum; \
89034852cSGleb Smirnoff   Unity.NumberOfTests++; \
99034852cSGleb Smirnoff   if (TEST_PROTECT()) \
109034852cSGleb Smirnoff   { \
119034852cSGleb Smirnoff       setUp(); \
129034852cSGleb Smirnoff       TestFunc(); \
139034852cSGleb Smirnoff   } \
149034852cSGleb Smirnoff   if (TEST_PROTECT() && !TEST_IS_IGNORED) \
159034852cSGleb Smirnoff   { \
169034852cSGleb Smirnoff     tearDown(); \
179034852cSGleb Smirnoff   } \
189034852cSGleb Smirnoff   UnityConcludeTest(); \
199034852cSGleb Smirnoff }
209034852cSGleb Smirnoff 
219034852cSGleb Smirnoff //=======Automagically Detected Files To Include=====
229034852cSGleb Smirnoff #include "unity.h"
239034852cSGleb Smirnoff #include <setjmp.h>
249034852cSGleb Smirnoff #include <stdio.h>
259034852cSGleb Smirnoff #include "config.h"
269034852cSGleb Smirnoff #include "ntp_types.h"
279034852cSGleb Smirnoff 
289034852cSGleb Smirnoff //=======External Functions This Runner Calls=====
299034852cSGleb Smirnoff extern void setUp(void);
309034852cSGleb Smirnoff extern void tearDown(void);
319034852cSGleb Smirnoff extern void testChangePrognameInMysyslog(void);
329034852cSGleb Smirnoff extern void testOpenLogfileTest(void);
339034852cSGleb Smirnoff extern void testWriteInCustomLogfile(void);
349034852cSGleb Smirnoff 
359034852cSGleb Smirnoff 
3609100258SXin LI //=======Suite Setup=====
suite_setup(void)3709100258SXin LI static void suite_setup(void)
3809100258SXin LI {
39*2d4e511cSCy Schubert extern int change_iobufs(int);
4009100258SXin LI extern int change_logfile(const char*, int);
41*2d4e511cSCy Schubert change_iobufs(1);
4209100258SXin LI change_logfile("stderr", 0);
4309100258SXin LI }
4409100258SXin LI 
459034852cSGleb Smirnoff //=======Test Reset Option=====
469034852cSGleb Smirnoff void resetTest(void);
resetTest(void)479034852cSGleb Smirnoff void resetTest(void)
489034852cSGleb Smirnoff {
499034852cSGleb Smirnoff   tearDown();
509034852cSGleb Smirnoff   setUp();
519034852cSGleb Smirnoff }
529034852cSGleb Smirnoff 
539034852cSGleb Smirnoff char const *progname;
549034852cSGleb Smirnoff 
559034852cSGleb Smirnoff 
569034852cSGleb Smirnoff //=======MAIN=====
main(int argc,char * argv[])579034852cSGleb Smirnoff int main(int argc, char *argv[])
589034852cSGleb Smirnoff {
599034852cSGleb Smirnoff   progname = argv[0];
6009100258SXin LI   suite_setup();
619034852cSGleb Smirnoff   UnityBegin("t-log.c");
623311ff84SXin LI   RUN_TEST(testChangePrognameInMysyslog, 10);
633311ff84SXin LI   RUN_TEST(testOpenLogfileTest, 11);
643311ff84SXin LI   RUN_TEST(testWriteInCustomLogfile, 12);
659034852cSGleb Smirnoff 
669034852cSGleb Smirnoff   return (UnityEnd());
679034852cSGleb Smirnoff }
68