aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-02-01 12:08:51 +0000
committerNathan S. Evans <evans@in.tum.de>2010-02-01 12:08:51 +0000
commit1ae18596e812235ee505338bb2fbfd445ae9d6cf (patch)
tree3f65bd21bae7574e1ade4a0bfb6315b12ecd3335 /src/transport/test_transport_api.c
parent63aa9b10e3f94249a3308ef52fad4445211f3596 (diff)
downloadgnunet-1ae18596e812235ee505338bb2fbfd445ae9d6cf.tar.gz
gnunet-1ae18596e812235ee505338bb2fbfd445ae9d6cf.zip
change test cases to not write configs
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r--src/transport/test_transport_api.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index dd9321546..b761f33af 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -259,6 +259,7 @@ exchange_hello (void *cls,
259 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); 259 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
260} 260}
261 261
262#if WRITECONFIG
262static void 263static void
263setTransportOptions(char * filename) 264setTransportOptions(char * filename)
264{ 265{
@@ -294,6 +295,7 @@ setTransportOptions(char * filename)
294 GNUNET_CONFIGURATION_destroy(tempcfg); 295 GNUNET_CONFIGURATION_destroy(tempcfg);
295 return; 296 return;
296} 297}
298#endif
297 299
298static void 300static void
299run (void *cls, 301run (void *cls,
@@ -305,14 +307,19 @@ run (void *cls,
305 OKPP; 307 OKPP;
306 sched = s; 308 sched = s;
307 309
308 setTransportOptions("test_transport_api_peer1.conf");
309 setTransportOptions("test_transport_api_peer2.conf");
310
311 die_task = GNUNET_SCHEDULER_add_delayed (sched, 310 die_task = GNUNET_SCHEDULER_add_delayed (sched,
312 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 1), &end_badly, NULL); 311 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 1), &end_badly, NULL);
313 312
314 setup_peer (&p1, "test_transport_api_peer1.conf"); 313 if (is_udp)
315 setup_peer (&p2, "test_transport_api_peer2.conf"); 314 {
315 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
316 setup_peer (&p2, "test_transport_api_udp_peer2.conf");
317 }
318 else if (is_tcp)
319 {
320 setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
321 setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
322 }
316 323
317 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1); 324 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
318} 325}
@@ -330,7 +337,9 @@ check ()
330 NULL 337 NULL
331 }; 338 };
332 339
340#if WRITECONFIG
333 setTransportOptions("test_transport_api_data.conf"); 341 setTransportOptions("test_transport_api_data.conf");
342#endif
334 343
335 struct GNUNET_GETOPT_CommandLineOption options[] = { 344 struct GNUNET_GETOPT_CommandLineOption options[] = {
336 GNUNET_GETOPT_OPTION_END 345 GNUNET_GETOPT_OPTION_END