aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_testing.c')
-rw-r--r--src/transport/test_transport_testing.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/transport/test_transport_testing.c b/src/transport/test_transport_testing.c
index 842d68651..7b04d9370 100644
--- a/src/transport/test_transport_testing.c
+++ b/src/transport/test_transport_testing.c
@@ -29,20 +29,9 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_common.h" 30#include "gnunet_common.h"
31#include "gnunet_hello_lib.h" 31#include "gnunet_hello_lib.h"
32#include "gnunet_getopt_lib.h"
33#include "gnunet_os_lib.h"
34#include "gnunet_program_lib.h"
35#include "gnunet_scheduler_lib.h" 32#include "gnunet_scheduler_lib.h"
36#include "gnunet_transport_service.h" 33#include "gnunet_transport_service.h"
37#include "transport.h"
38#include "transport-testing.h" 34#include "transport-testing.h"
39
40#define VERBOSE GNUNET_NO
41
42#define VERBOSE_ARM GNUNET_NO
43
44#define START_ARM GNUNET_YES
45
46/** 35/**
47 * How long until we give up on transmitting the message? 36 * How long until we give up on transmitting the message?
48 */ 37 */
@@ -81,6 +70,12 @@ end_badly ()
81 timeout_task = GNUNET_SCHEDULER_NO_TASK; 70 timeout_task = GNUNET_SCHEDULER_NO_TASK;
82 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 71 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
83 72
73 if (NULL != cc)
74 {
75 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
76 cc = NULL;
77 }
78
84 if (p1 != NULL) 79 if (p1 != NULL)
85 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); 80 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
86 if (p2 != NULL) 81 if (p2 != NULL)
@@ -167,15 +162,11 @@ run (void *cls, char *const *args, const char *cfgfile,
167 1, &notify_receive, &notify_connect, 162 1, &notify_receive, &notify_connect,
168 &notify_disconnect, &start_cb, p1); 163 &notify_disconnect, &start_cb, p1);
169 164
170 GNUNET_assert (p1->hostkeyfile != NULL);
171
172 p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, 165 p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth,
173 "test_transport_api_tcp_peer2.conf", 166 "test_transport_api_tcp_peer2.conf",
174 2, &notify_receive, &notify_connect, 167 2, &notify_receive, &notify_connect,
175 &notify_disconnect, &start_cb, p2); 168 &notify_disconnect, &start_cb, p2);
176 169
177 GNUNET_assert (p2->hostkeyfile != NULL);
178
179 if (p1 == NULL) 170 if (p1 == NULL)
180 { 171 {
181 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 172 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -198,19 +189,12 @@ int
198main (int argc, char *argv[]) 189main (int argc, char *argv[])
199{ 190{
200 GNUNET_log_setup ("test_transport_testing", 191 GNUNET_log_setup ("test_transport_testing",
201#if VERBOSE
202 "DEBUG",
203#else
204 "WARNING", 192 "WARNING",
205#endif
206 NULL); 193 NULL);
207 194
208 char *const argv_1[] = { "test_transport_testing", 195 char *const argv_1[] = { "test_transport_testing",
209 "-c", 196 "-c",
210 "test_transport_api_data.conf", 197 "test_transport_api_data.conf",
211#if VERBOSE
212 "-L", "DEBUG",
213#endif
214 NULL 198 NULL
215 }; 199 };
216 200