OpenDNSSEC-enforcer
1.4.6
Main Page
Data Structures
Files
File List
Globals
enforcer
test
cunit
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
}
TestMsg
int TestMsg(void)
Definition:
test_message.c:241
TestStr2
int TestStr2(void)
Definition:
test_string_util2.c:425
main
int main(int argc, char **argv)
Definition:
test.c:86
TestDb
int TestDb(void)
Definition:
test_database.c:444
TestDqs
int TestDqs(void)
Definition:
test_dq_string.c:212
TestDus
int TestDus(void)
Definition:
test_du_string.c:254
TestDds
int TestDds(void)
Definition:
test_dd_string.c:179
TestKeyword
int TestKeyword(void)
Definition:
test_keyword.c:244
TestKsmImport
int TestKsmImport(void)
Definition:
test_ksm_import.c:249
TestKsmPurge
int TestKsmPurge(void)
Definition:
test_ksm_purge.c:126
TestKsmRequest
int TestKsmRequest(void)
Definition:
test_ksm_request.c:144
TestDt
int TestDt(void)
Definition:
test_datetime.c:871
test_routines.h
TestInitialize
void TestInitialize(int argc, char **argv)
Definition:
test_routines.c:168
TestKsmKeyDelete
int TestKsmKeyDelete(void)
Definition:
test_ksm_key_delete.c:219
TcuExecute
void TcuExecute(void)
Definition:
test_routines_cunit.c:84
TestDis
int TestDis(void)
Definition:
test_di_string.c:94
TestKsmParameter
int TestKsmParameter(void)
Definition:
test_ksm_parameter.c:150
TestStr
int TestStr(void)
Definition:
test_string_util.c:555
TestKsmPolicy
int TestKsmPolicy(void)
Definition:
test_ksm_policy.c:220
TestKsmUpdate
int TestKsmUpdate(void)
Definition:
test_ksm_update.c:100
TestKsmKey
int TestKsmKey(void)
Definition:
test_ksm_key.c:369
TestKsmZone
int TestKsmZone(void)
Definition:
test_ksm_zone.c:127
TcuInitialize
void TcuInitialize(void)
Definition:
test_routines_cunit.c:63
Generated on Tue Jul 22 2014 05:12:19 for OpenDNSSEC-enforcer by
1.8.7