diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-01-10 10:53:56 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-01-10 10:53:56 +0000 |
commit | 6fc2d99bce3466f3e0e00b9ea1c48f2930407dc8 (patch) | |
tree | 0d7132858269c76db12ec9598381a9d634a71680 /src/core | |
parent | e28fa6841e5c8aec4568946b7a42f2f75eb60e03 (diff) | |
download | gnunet-6fc2d99bce3466f3e0e00b9ea1c48f2930407dc8.tar.gz gnunet-6fc2d99bce3466f3e0e00b9ea1c48f2930407dc8.zip |
proper testcase functioning
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/test_core_api_send_to_self.c | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index 3f29682d8..55137dcc9 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c | |||
@@ -178,6 +178,7 @@ run (void *cls, | |||
178 | "-c", "test_core_api_peer1.conf", NULL); | 178 | "-c", "test_core_api_peer1.conf", NULL); |
179 | 179 | ||
180 | GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_load (core_cfg, "test_core_api_peer1.conf")); | 180 | GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_load (core_cfg, "test_core_api_peer1.conf")); |
181 | |||
181 | core = GNUNET_CORE_connect (core_cfg, | 182 | core = GNUNET_CORE_connect (core_cfg, |
182 | 42, | 183 | 42, |
183 | NULL, | 184 | NULL, |
@@ -188,16 +189,19 @@ run (void *cls, | |||
188 | die_task = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60), &cleanup, cls); | 189 | die_task = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60), &cleanup, cls); |
189 | } | 190 | } |
190 | 191 | ||
191 | /** | 192 | |
192 | * The main function to obtain template from gnunetd. | 193 | static int |
193 | * | 194 | check () |
194 | * @param argc number of arguments from the command line | ||
195 | * @param argv command line arguments | ||
196 | * @return 0 ok, 1 on error | ||
197 | */ | ||
198 | int | ||
199 | main (int argc, char *const *argv) | ||
200 | { | 195 | { |
196 | char *const argv[] = { "test-core-api-send-to-self", | ||
197 | "-c", | ||
198 | "test_core_api_data.conf", | ||
199 | #if VERBOSE | ||
200 | "-L", "DEBUG", | ||
201 | #endif | ||
202 | NULL | ||
203 | }; | ||
204 | |||
201 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 205 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
202 | GNUNET_GETOPT_OPTION_END | 206 | GNUNET_GETOPT_OPTION_END |
203 | }; | 207 | }; |
@@ -205,11 +209,33 @@ main (int argc, char *const *argv) | |||
205 | ret = 1; | 209 | ret = 1; |
206 | 210 | ||
207 | return (GNUNET_OK == | 211 | return (GNUNET_OK == |
208 | GNUNET_PROGRAM_run (argc, | 212 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
209 | argv, | 213 | argv, |
210 | "test_core_api_send_to_self", | 214 | "test_core_api_send_to_self", |
211 | gettext_noop ("help text"), | 215 | gettext_noop ("help text"), |
212 | options, &run, NULL)) ? ret : 1; | 216 | options, &run, NULL)) ? ret : 1; |
213 | } | 217 | } |
214 | 218 | ||
219 | /** | ||
220 | * The main function to obtain template from gnunetd. | ||
221 | * | ||
222 | * @param argc number of arguments from the command line | ||
223 | * @param argv command line arguments | ||
224 | * @return 0 ok, 1 on error | ||
225 | */ | ||
226 | int | ||
227 | main (int argc, char *argv[]) | ||
228 | { | ||
229 | GNUNET_log_setup ("test-core-api-send-to-self", | ||
230 | #if VERBOSE | ||
231 | "DEBUG", | ||
232 | #else | ||
233 | "WARNING", | ||
234 | #endif | ||
235 | NULL); | ||
236 | ret = check (); | ||
237 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); | ||
238 | return ret; | ||
239 | } | ||
240 | |||
215 | /* end of test_core_api_send_to_self.c */ | 241 | /* end of test_core_api_send_to_self.c */ |