aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ntp/tests/libntp/run-calendar.c
blob: 82309bd3b8f7161d6376a846999e9213156526c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* AUTOGENERATED FILE. DO NOT EDIT. */

//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
  Unity.CurrentTestName = #TestFunc; \
  Unity.CurrentTestLineNumber = TestLineNum; \
  Unity.NumberOfTests++; \
  if (TEST_PROTECT()) \
  { \
      setUp(); \
      TestFunc(); \
  } \
  if (TEST_PROTECT() && !TEST_IS_IGNORED) \
  { \
    tearDown(); \
  } \
  UnityConcludeTest(); \
}

//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
#include "config.h"
#include "ntp_stdlib.h"
#include "ntp_calendar.h"
#include "ntp_unixtime.h"
#include <string.h>

//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_DaySplitMerge(void);
extern void test_SplitYearDays1(void);
extern void test_SplitYearDays2(void);
extern void test_RataDie1(void);
extern void test_LeapYears1(void);
extern void test_LeapYears2(void);
extern void test_RoundTripDate(void);
extern void test_RoundTripYearStart(void);
extern void test_RoundTripMonthStart(void);
extern void test_RoundTripWeekStart(void);
extern void test_RoundTripDayStart(void);
extern void test_IsoCalYearsToWeeks(void);
extern void test_IsoCalWeeksToYearStart(void);
extern void test_IsoCalWeeksToYearEnd(void);
extern void test_DaySecToDate(void);
extern void test_NtpToNtp(void);
extern void test_NtpToTime(void);


//=======Test Reset Option=====
void resetTest(void);
void resetTest(void)
{
  tearDown();
  setUp();
}

char const *progname;


//=======MAIN=====
int main(int argc, char *argv[])
{
  progname = argv[0];
  UnityBegin("calendar.c");
  RUN_TEST(test_DaySplitMerge, 24);
  RUN_TEST(test_SplitYearDays1, 25);
  RUN_TEST(test_SplitYearDays2, 26);
  RUN_TEST(test_RataDie1, 27);
  RUN_TEST(test_LeapYears1, 28);
  RUN_TEST(test_LeapYears2, 29);
  RUN_TEST(test_RoundTripDate, 30);
  RUN_TEST(test_RoundTripYearStart, 31);
  RUN_TEST(test_RoundTripMonthStart, 32);
  RUN_TEST(test_RoundTripWeekStart, 33);
  RUN_TEST(test_RoundTripDayStart, 34);
  RUN_TEST(test_IsoCalYearsToWeeks, 35);
  RUN_TEST(test_IsoCalWeeksToYearStart, 36);
  RUN_TEST(test_IsoCalWeeksToYearEnd, 37);
  RUN_TEST(test_DaySecToDate, 38);
  RUN_TEST(test_NtpToNtp, 40);
  RUN_TEST(test_NtpToTime, 41);

  return (UnityEnd());
}