tests/sv/test_sv.c
/* [<][>][^][v][top][bottom][index][help] */
FUNCTIONS
This source file includes following functions.
- SK_close_listening_socket
- TH_run
- TH_do_whois
- TH_do_config
- SK_get_connection
- CO_get_whois_port
- OB_init
- do_whois
- SK_atoport
- SK_getsock
- do_config
- CO_get_config_port
- CO_get_query_logging
- CO_get_query_logfile
- CO_get_password
- CO_get_database_port
- CO_get_rt_query
- CO_get_in_query
- CO_get_user
- CO_get_host
- error_init
- main
1 /***************************************
2 $Revision: 1.3 $
3
4 Example code: Unit test driver for server.c
5
6 ******************/ /******************
7 Modification History:
8 ottrey (21/04/1999) Created.
9 ******************/ /******************
10 Copyright (c) 1999 RIPE NCC
11
12 All Rights Reserved
13
14 Permission to use, copy, modify, and distribute this software and its
15 documentation for any purpose and without fee is hereby granted,
16 provided that the above copyright notice appear in all copies and that
17 both that copyright notice and this permission notice appear in
18 supporting documentation, and that the name of the author not be
19 used in advertising or publicity pertaining to distribution of the
20 software without specific, written prior permission.
21
22 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
23 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
24 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
25 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
26 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
27 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28 ***************************************/
29 #include "../test_.c" /* test driver template */
30 #include "erroutines.h"
31
32
33 #define TEST1 "1 SV_start()"
34
35 SK_close_listening_socket() {
/* [<][>][^][v][top][bottom][index][help] */
36 printf("Call to SK_close_listening_socket()\n");
37 } /* SK_close_listening_socket() */
38
39 TH_run() {
/* [<][>][^][v][top][bottom][index][help] */
40 printf("Call to TH_run()\n");
41 } /* TH_run() */
42
43 TH_do_whois() {
/* [<][>][^][v][top][bottom][index][help] */
44 printf("Call to TH_do_whois()\n");
45 } /* TH_do_whois() */
46
47 TH_do_config() {
/* [<][>][^][v][top][bottom][index][help] */
48 printf("Call to TH_do_config()\n");
49 } /* TH_do_config() */
50
51 SK_get_connection() {
/* [<][>][^][v][top][bottom][index][help] */
52 char str[STR_S];
53 printf("Call to SK_get_connection()\n");
54 printf("... waiting for new client [Hit return]");
55
56 gets(str);
57
58 } /* SK_get_connection() */
59
60 char *CO_get_whois_port() {
/* [<][>][^][v][top][bottom][index][help] */
61 return "3333";
62 } /* CO_get_whois_port() */
63
64 OB_init() {
/* [<][>][^][v][top][bottom][index][help] */
65 printf("Call to OB_init()\n");
66 } /* OB_init() */
67
68 do_whois() {
/* [<][>][^][v][top][bottom][index][help] */
69 printf("Call to do_whois()\n");
70 } /* do_whois() */
71
72 SK_atoport() {
/* [<][>][^][v][top][bottom][index][help] */
73 printf("Call to SK_atoport()\n");
74 } /* SK_atoport() */
75
76 SK_getsock() {
/* [<][>][^][v][top][bottom][index][help] */
77 printf("Call to SK_getsock()\n");
78 } /* SK_getsock() */
79
80 do_config() {
/* [<][>][^][v][top][bottom][index][help] */
81 printf("Call to do_config()\n");
82 } /* do_config() */
83
84 char *CO_get_config_port() {
/* [<][>][^][v][top][bottom][index][help] */
85 return "3334";
86 } /* CO_get_config_port() */
87
88 int CO_get_query_logging() {
/* [<][>][^][v][top][bottom][index][help] */
89 return 1;
90 } /* CO_get_query_logging() */
91
92 char *CO_get_query_logfile() {
/* [<][>][^][v][top][bottom][index][help] */
93 return "stdout";
94 } /* CO_get_query_logfile() */
95
96 const char *CO_get_password() {
/* [<][>][^][v][top][bottom][index][help] */
97 printf("Call to CO_get_password()\n");
98 } /* CO_get_password() */
99
100 const char *CO_get_database_port() {
/* [<][>][^][v][top][bottom][index][help] */
101 printf("Call to CO_get_database_port()\n");
102 } /* CO_get_database_port() */
103
104 const char *CO_get_rt_query() {
/* [<][>][^][v][top][bottom][index][help] */
105 printf("Call to CO_get_rt_query()\n");
106 } /* CO_get_rt_query() */
107
108 const char *CO_get_in_query() {
/* [<][>][^][v][top][bottom][index][help] */
109 printf("Call to CO_get_in_query()\n");
110 } /* CO_get_in_query() */
111
112 const char *CO_get_user() {
/* [<][>][^][v][top][bottom][index][help] */
113 printf("Call to CO_get_user()\n");
114 } /* CO_get_user() */
115
116 const char *CO_get_host() {
/* [<][>][^][v][top][bottom][index][help] */
117 printf("Call to CO_get_host()\n");
118 } /* CO_get_host() */
119
120
121
122 void error_init(int argc, char ** argv) {
/* [<][>][^][v][top][bottom][index][help] */
123 er_path_t erlogstr;
124
125 ER_init(argc, argv);
126
127 erlogstr.fdes = stderr;
128 erlogstr.asp = MA_new(MA_END);
129 erlogstr.sev = ER_SEV_W;
130 erlogstr.mode = ER_M_SEVCHAR | ER_M_TEXTLONG;
131
132 ER_setpath(& erlogstr);
133
134 } /* error_init() */
135
136
137
138 int main(int argc, char** argv) {
/* [<][>][^][v][top][bottom][index][help] */
139
140 char *str;
141
142 /* Get options */
143 get_options(argc, argv);
144
145 Infile_name = "";
146
147 /* TEST1 */
148 if(Test[1] == 1) {
149 print_title(TEST1);
150
151 error_init(argc, argv);
152 SV_start();
153 } /* TEST1 */
154
155 return(0);
156
157 } /* main() */
158