OpenDNSSEC-enforcer  1.4.7
test.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2009 Nominet UK. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 /*+
28  * Filename: test.c
29  *
30  * Description:
31  * Main routine for the running of the various test programs.
32 -*/
33 
34 #include <assert.h>
35 #include <stdio.h>
36 
37 #include "CUnit/Basic.h"
38 
39 #include "test_routines.h"
40 
41 /* Define the external test routines (each of these creates a suite) */
42 
43 /* Database files */
44 int TestDb(void);
45 int TestDds(void);
46 int TestDis(void);
47 int TestDqs(void);
48 int TestDus(void);
49 int TestDt(void);
50 
51 /* Utility files */
52 int TestKeyword(void);
53 int TestMsg(void);
54 int TestStr(void);
55 int TestStr2(void);
56 
57 /* The KSM files */
58 /*int KsmInitRundown(void);*/
59 /*int KsmKeyword(void); - tested in TestKeyword above */
60 int TestKsmPurge(void);
61 int TestKsmKey(void);
62 int TestKsmParameter(void);
63 int TestKsmRequest(void);
64 int TestKsmKeyDelete(void);
65 /*int TestKsmParameterValue(void);*/
66 int TestKsmUpdate(void);
67 int TestKsmPolicy(void);
68 int TestKsmZone(void);
69 int TestKsmImport(void);
70 
71 /*
72  * main() - Main Testing Routine
73  *
74  * Description:
75  * Runs the tests and prints success or failre.
76  *
77  * Arguments:
78  * -m Print messages from routines in "util".
79  *
80  * Returns:
81  * int
82  * 0 on success
83  * CUnit error code on failure.
84  */
85 
86 int main(int argc, char **argv)
87 {
88  TestInitialize(argc, argv);
89  TcuInitialize();
90 
91  /*
92  * Add the test suites to the registry (with the ones that take the shortest
93  * amount of time first).
94  */
95 
96  if (
97  (! TestDb()) &&
98  (! TestDds()) &&
99  (! TestDis()) &&
100  (! TestDqs()) &&
101  (! TestDus()) &&
102  (! TestDt()) &&
103  (! TestKeyword()) &&
104  (! TestMsg()) &&
105  (! TestStr()) &&
106 /* (! TestStr2()) && */
107  (! TestKsmPurge()) &&
108  (! TestKsmKey()) &&
109  (! TestKsmParameter()) &&
110  (! TestKsmRequest()) &&
111  (! TestKsmKeyDelete()) &&
112  (! TestKsmUpdate()) &&
113  (! TestKsmPolicy()) &&
114  (! TestKsmZone()) &&
115  (! TestKsmImport())
116  ) {
117 
118  /* Run all the tests */
119 
120  TcuExecute();
121  }
122 
123  return CU_get_number_of_failure_records();
124 }
int TestMsg(void)
Definition: test_message.c:241
int TestStr2(void)
int main(int argc, char **argv)
Definition: test.c:86
int TestDb(void)
int TestDqs(void)
int TestDus(void)
int TestDds(void)
int TestKeyword(void)
Definition: test_keyword.c:244
int TestKsmImport(void)
int TestKsmPurge(void)
int TestKsmRequest(void)
int TestDt(void)
void TestInitialize(int argc, char **argv)
int TestKsmKeyDelete(void)
void TcuExecute(void)
int TestDis(void)
int TestKsmParameter(void)
int TestStr(void)
int TestKsmPolicy(void)
int TestKsmUpdate(void)
int TestKsmKey(void)
Definition: test_ksm_key.c:369
int TestKsmZone(void)
void TcuInitialize(void)