xref: /netbsd-src/external/bsd/ntp/dist/tests/libntp/run-timevalops.c (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1*cdfa2a7eSchristos /*	$NetBSD: run-timevalops.c,v 1.3 2020/05/25 20:47:36 christos Exp $	*/
248f8ae19Schristos 
3f17b710fSchristos /* AUTOGENERATED FILE. DO NOT EDIT. */
4f17b710fSchristos 
5f17b710fSchristos //=======Test Runner Used To Run Each Test Below=====
6f17b710fSchristos #define RUN_TEST(TestFunc, TestLineNum) \
7f17b710fSchristos { \
8f17b710fSchristos   Unity.CurrentTestName = #TestFunc; \
9f17b710fSchristos   Unity.CurrentTestLineNumber = TestLineNum; \
10f17b710fSchristos   Unity.NumberOfTests++; \
11f17b710fSchristos   if (TEST_PROTECT()) \
12f17b710fSchristos   { \
13f17b710fSchristos       setUp(); \
14f17b710fSchristos       TestFunc(); \
15f17b710fSchristos   } \
16f17b710fSchristos   if (TEST_PROTECT() && !TEST_IS_IGNORED) \
17f17b710fSchristos   { \
18f17b710fSchristos     tearDown(); \
19f17b710fSchristos   } \
20f17b710fSchristos   UnityConcludeTest(); \
21f17b710fSchristos }
22f17b710fSchristos 
23f17b710fSchristos //=======Automagically Detected Files To Include=====
24f17b710fSchristos #include "unity.h"
25f17b710fSchristos #include <setjmp.h>
26f17b710fSchristos #include <stdio.h>
27a6f3f22fSchristos #include "config.h"
28a6f3f22fSchristos #include "ntp_types.h"
29a6f3f22fSchristos #include "ntp_fp.h"
30a6f3f22fSchristos #include "timevalops.h"
31a6f3f22fSchristos #include <math.h>
32f17b710fSchristos 
33f17b710fSchristos //=======External Functions This Runner Calls=====
34f17b710fSchristos extern void setUp(void);
35f17b710fSchristos extern void tearDown(void);
36a6f3f22fSchristos extern void test_Helpers1(void);
37a6f3f22fSchristos extern void test_Normalise(void);
38a6f3f22fSchristos extern void test_SignNoFrac(void);
39a6f3f22fSchristos extern void test_SignWithFrac(void);
40a6f3f22fSchristos extern void test_CmpFracEQ(void);
41a6f3f22fSchristos extern void test_CmpFracGT(void);
42a6f3f22fSchristos extern void test_CmpFracLT(void);
43a6f3f22fSchristos extern void test_AddFullNorm(void);
44a6f3f22fSchristos extern void test_AddFullOflow1(void);
45a6f3f22fSchristos extern void test_AddUsecNorm(void);
46a6f3f22fSchristos extern void test_AddUsecOflow1(void);
47a6f3f22fSchristos extern void test_SubFullNorm(void);
48a6f3f22fSchristos extern void test_SubFullOflow(void);
49a6f3f22fSchristos extern void test_SubUsecNorm(void);
50a6f3f22fSchristos extern void test_SubUsecOflow(void);
51a6f3f22fSchristos extern void test_Neg(void);
52a6f3f22fSchristos extern void test_AbsNoFrac(void);
53a6f3f22fSchristos extern void test_AbsWithFrac(void);
54a6f3f22fSchristos extern void test_Helpers2(void);
55a6f3f22fSchristos extern void test_ToLFPbittest(void);
56a6f3f22fSchristos extern void test_ToLFPrelPos(void);
57a6f3f22fSchristos extern void test_ToLFPrelNeg(void);
58a6f3f22fSchristos extern void test_ToLFPabs(void);
59a6f3f22fSchristos extern void test_FromLFPbittest(void);
60a6f3f22fSchristos extern void test_FromLFPrelPos(void);
61a6f3f22fSchristos extern void test_FromLFPrelNeg(void);
62a6f3f22fSchristos extern void test_LFProundtrip(void);
63a6f3f22fSchristos extern void test_ToString(void);
64f17b710fSchristos 
65f17b710fSchristos 
6656f2724eSchristos //=======Suite Setup=====
suite_setup(void)6756f2724eSchristos static void suite_setup(void)
6856f2724eSchristos {
69*cdfa2a7eSchristos extern int change_iobufs(int);
7056f2724eSchristos extern int change_logfile(const char*, int);
71*cdfa2a7eSchristos change_iobufs(1);
7256f2724eSchristos change_logfile("stderr", 0);
7356f2724eSchristos }
7456f2724eSchristos 
75f17b710fSchristos //=======Test Reset Option=====
76a6f3f22fSchristos void resetTest(void);
resetTest(void)77a6f3f22fSchristos void resetTest(void)
78f17b710fSchristos {
79f17b710fSchristos   tearDown();
80f17b710fSchristos   setUp();
81f17b710fSchristos }
82f17b710fSchristos 
83a6f3f22fSchristos char const *progname;
84f17b710fSchristos 
85f17b710fSchristos 
86f17b710fSchristos //=======MAIN=====
main(int argc,char * argv[])87f17b710fSchristos int main(int argc, char *argv[])
88f17b710fSchristos {
89f17b710fSchristos   progname = argv[0];
9056f2724eSchristos   suite_setup();
91f17b710fSchristos   UnityBegin("timevalops.c");
92ae49d4a4Schristos   RUN_TEST(test_Helpers1, 37);
93ae49d4a4Schristos   RUN_TEST(test_Normalise, 38);
94ae49d4a4Schristos   RUN_TEST(test_SignNoFrac, 39);
95ae49d4a4Schristos   RUN_TEST(test_SignWithFrac, 40);
96ae49d4a4Schristos   RUN_TEST(test_CmpFracEQ, 41);
97ae49d4a4Schristos   RUN_TEST(test_CmpFracGT, 42);
98ae49d4a4Schristos   RUN_TEST(test_CmpFracLT, 43);
99ae49d4a4Schristos   RUN_TEST(test_AddFullNorm, 44);
100ae49d4a4Schristos   RUN_TEST(test_AddFullOflow1, 45);
101ae49d4a4Schristos   RUN_TEST(test_AddUsecNorm, 46);
102ae49d4a4Schristos   RUN_TEST(test_AddUsecOflow1, 47);
103ae49d4a4Schristos   RUN_TEST(test_SubFullNorm, 48);
104ae49d4a4Schristos   RUN_TEST(test_SubFullOflow, 49);
105ae49d4a4Schristos   RUN_TEST(test_SubUsecNorm, 50);
106ae49d4a4Schristos   RUN_TEST(test_SubUsecOflow, 51);
107ae49d4a4Schristos   RUN_TEST(test_Neg, 52);
108ae49d4a4Schristos   RUN_TEST(test_AbsNoFrac, 53);
109ae49d4a4Schristos   RUN_TEST(test_AbsWithFrac, 54);
110ae49d4a4Schristos   RUN_TEST(test_Helpers2, 55);
111ae49d4a4Schristos   RUN_TEST(test_ToLFPbittest, 56);
112ae49d4a4Schristos   RUN_TEST(test_ToLFPrelPos, 57);
113ae49d4a4Schristos   RUN_TEST(test_ToLFPrelNeg, 58);
114ae49d4a4Schristos   RUN_TEST(test_ToLFPabs, 59);
115ae49d4a4Schristos   RUN_TEST(test_FromLFPbittest, 60);
116ae49d4a4Schristos   RUN_TEST(test_FromLFPrelPos, 61);
117ae49d4a4Schristos   RUN_TEST(test_FromLFPrelNeg, 62);
118ae49d4a4Schristos   RUN_TEST(test_LFProundtrip, 63);
119ae49d4a4Schristos   RUN_TEST(test_ToString, 64);
120f17b710fSchristos 
121f17b710fSchristos   return (UnityEnd());
122f17b710fSchristos }
123