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