diff options
Diffstat (limited to 'src/transport/test_transport_api_reliability.c')
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 154301656..94865f438 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -92,7 +92,7 @@ static int ok; | |||
92 | /** | 92 | /** |
93 | * Context of peer 1 | 93 | * Context of peer 1 |
94 | */ | 94 | */ |
95 | static struct PeerContext *p1; | 95 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p1; |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Configuration file of peer 1 | 98 | * Configuration file of peer 1 |
@@ -102,7 +102,7 @@ static char *cfg_file_p1; | |||
102 | /** | 102 | /** |
103 | * Context of peer 2 | 103 | * Context of peer 2 |
104 | */ | 104 | */ |
105 | static struct PeerContext *p2; | 105 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p2; |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * Configuration file of peer 1 | 108 | * Configuration file of peer 1 |
@@ -122,7 +122,7 @@ static struct GNUNET_TRANSPORT_TransmitHandle *th; | |||
122 | /** | 122 | /** |
123 | * Transport testing handle | 123 | * Transport testing handle |
124 | */ | 124 | */ |
125 | static struct GNUNET_TRANSPORT_TESTING_handle *tth; | 125 | static struct GNUNET_TRANSPORT_TESTING_Handle *tth; |
126 | 126 | ||
127 | /* | 127 | /* |
128 | * Total amount of bytes sent | 128 | * Total amount of bytes sent |
@@ -215,11 +215,11 @@ end () | |||
215 | } | 215 | } |
216 | if (cc != NULL) | 216 | if (cc != NULL) |
217 | { | 217 | { |
218 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); | 218 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (cc); |
219 | cc = NULL; | 219 | cc = NULL; |
220 | } | 220 | } |
221 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); | 221 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); |
222 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); | 222 | GNUNET_TRANSPORT_TESTING_stop_peer (p2); |
223 | GNUNET_TRANSPORT_TESTING_done (tth); | 223 | GNUNET_TRANSPORT_TESTING_done (tth); |
224 | ok = 0; | 224 | ok = 0; |
225 | for (i = 0; i < TOTAL_MSGS; i++) | 225 | for (i = 0; i < TOTAL_MSGS; i++) |
@@ -274,13 +274,13 @@ end_badly () | |||
274 | } | 274 | } |
275 | if (cc != NULL) | 275 | if (cc != NULL) |
276 | { | 276 | { |
277 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); | 277 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (cc); |
278 | cc = NULL; | 278 | cc = NULL; |
279 | } | 279 | } |
280 | if (p1 != NULL) | 280 | if (p1 != NULL) |
281 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); | 281 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); |
282 | if (p2 != NULL) | 282 | if (p2 != NULL) |
283 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); | 283 | GNUNET_TRANSPORT_TESTING_stop_peer (p2); |
284 | GNUNET_TRANSPORT_TESTING_done (tth); | 284 | GNUNET_TRANSPORT_TESTING_done (tth); |
285 | ok = GNUNET_SYSERR; | 285 | ok = GNUNET_SYSERR; |
286 | } | 286 | } |
@@ -542,9 +542,7 @@ sendtask (void *cls) | |||
542 | 542 | ||
543 | 543 | ||
544 | static void | 544 | static void |
545 | testing_connect_cb (struct PeerContext *p1, | 545 | testing_connect_cb (void *cls) |
546 | struct PeerContext *p2, | ||
547 | void *cls) | ||
548 | { | 546 | { |
549 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); | 547 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); |
550 | 548 | ||
@@ -562,7 +560,7 @@ testing_connect_cb (struct PeerContext *p1, | |||
562 | 560 | ||
563 | 561 | ||
564 | static void | 562 | static void |
565 | start_cb (struct PeerContext *p, void *cls) | 563 | start_cb (struct GNUNET_TRANSPORT_TESTING_PeerContext *p, void *cls) |
566 | { | 564 | { |
567 | static int started; | 565 | static int started; |
568 | started++; | 566 | started++; |
@@ -576,7 +574,7 @@ start_cb (struct PeerContext *p, void *cls) | |||
576 | return; | 574 | return; |
577 | 575 | ||
578 | test_connected = GNUNET_NO; | 576 | test_connected = GNUNET_NO; |
579 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb, | 577 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, |
580 | NULL); | 578 | NULL); |
581 | 579 | ||
582 | } | 580 | } |
@@ -627,21 +625,18 @@ main (int argc, char *argv[]) | |||
627 | GNUNET_GETOPT_OPTION_END | 625 | GNUNET_GETOPT_OPTION_END |
628 | }; | 626 | }; |
629 | 627 | ||
630 | GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], | 628 | test_name = GNUNET_TRANSPORT_TESTING_get_test_name (argv[0]); |
631 | &test_name); | ||
632 | GNUNET_log_setup (test_name, | 629 | GNUNET_log_setup (test_name, |
633 | "WARNING", | 630 | "WARNING", |
634 | NULL); | 631 | NULL); |
635 | GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, | 632 | test_source = GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__); |
636 | &test_source); | 633 | test_plugin = GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], |
637 | GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], | 634 | test_source); |
638 | test_source, | ||
639 | &test_plugin); | ||
640 | 635 | ||
641 | tth = GNUNET_TRANSPORT_TESTING_init (); | 636 | tth = GNUNET_TRANSPORT_TESTING_init (); |
642 | 637 | ||
643 | GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1); | 638 | cfg_file_p1 = GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], 1); |
644 | GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2); | 639 | cfg_file_p2 = GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], 2); |
645 | 640 | ||
646 | #if WRITECONFIG | 641 | #if WRITECONFIG |
647 | setTransportOptions ("test_transport_api_data.conf"); | 642 | setTransportOptions ("test_transport_api_data.conf"); |