OpenDNSSEC-enforcer  1.4.1
test_routines.h
Go to the documentation of this file.
1 /*
2  * $Id: test_routines.h 4639 2011-03-24 13:06:12Z rb $
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 #ifndef TEST_ROUTINES_H
30 #define TEST_ROUTINES_H
31 
32 /*+
33  * Filename: test.h
34  *
35  * Description:
36  * Definitions of structures and routines for the CUnit-based module
37  * tests.
38 -*/
39 
40 #include <pthread.h>
41 #include <unistd.h>
42 
43 #include "ksm/system_includes.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /* Structure due to define tests in a suite */
50 
51 struct test_testdef {
52  const char* title; /* Test title - must be unique within a suite */
53  void (*function)(); /* Function executing the test */
54 };
55 
56 /* Structure for creating background threads */
57 
59  const char** lines; /* Pointer to the data to be written */
60  unsigned int* lengths; /* Pointer to data lengths */
61  int fd; /* File descriptor */
62  int first_delay; /* First delay */
63  int subsequent_delay; /* Subsequent delay */
64 };
65 
66 /* Common test routines */
67 
68 void TestInitialize(int argc, char** argv);
69 
70 /* Option access routines */
71 
72 int TestGetAutomatic(void);
73 int TestGetBasic(void);
74 int TestGetCurses(void);
75 int TestGetConsole(void);
76 int TestGetList(void);
77 const char* TestGetFilename(void);
78 
79 /* CUnuit test routines */
80 
81 void TcuInitialize(void);
82 void TcuExecute(void);
83 int TcuCreateSuite(const char* title, int (*init)(), int (*teardown)(),
84  struct test_testdef* tests);
85 
86 /* Database access */
87 
88 const char* TdbUsername(void);
89 const char* TdbPassword(void);
90 const char* TdbHost(void);
91 const char* TdbPort(void);
92 const char* TdbName(void);
93 
94 int TdbSetup(void);
95 int TdbTeardown(void);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
const char * TdbPort(void)
int TcuCreateSuite(const char *title, int(*init)(), int(*teardown)(), struct test_testdef *tests)
unsigned int * lengths
Definition: test_routines.h:60
int TestGetAutomatic(void)
int TestGetBasic(void)
int TestGetCurses(void)
const char * TdbUsername(void)
void TestInitialize(int argc, char **argv)
const char * TdbName(void)
int TestGetConsole(void)
void TcuExecute(void)
const char * TestGetFilename(void)
int TdbTeardown(void)
int TdbSetup(void)
int TestGetList(void)
const char ** lines
Definition: test_routines.h:59
const char * TdbPassword(void)
const char * TdbHost(void)
const char * title
Definition: test_routines.h:52
void TcuInitialize(void)