diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-09 22:34:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-09 22:34:49 +0000 |
commit | c0b81510ffe194dc662c3a6267d5e66a69873c4b (patch) | |
tree | 5ad5cc473d6993523be80bcf1430230e224d9216 /src/transport/test_transport_testing_startstop.c | |
parent | a7345f7436c421fd15e18e87ec399ea93b6dde03 (diff) | |
download | gnunet-c0b81510ffe194dc662c3a6267d5e66a69873c4b.tar.gz gnunet-c0b81510ffe194dc662c3a6267d5e66a69873c4b.zip |
-start to refactor testcases for sanity
Diffstat (limited to 'src/transport/test_transport_testing_startstop.c')
-rw-r--r-- | src/transport/test_transport_testing_startstop.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/transport/test_transport_testing_startstop.c b/src/transport/test_transport_testing_startstop.c index b30f8b5ec..6263f4d18 100644 --- a/src/transport/test_transport_testing_startstop.c +++ b/src/transport/test_transport_testing_startstop.c | |||
@@ -34,9 +34,9 @@ | |||
34 | 34 | ||
35 | struct GNUNET_SCHEDULER_Task * timeout_task; | 35 | struct GNUNET_SCHEDULER_Task * timeout_task; |
36 | 36 | ||
37 | static struct PeerContext *p; | 37 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p; |
38 | 38 | ||
39 | struct GNUNET_TRANSPORT_TESTING_handle *tth; | 39 | struct GNUNET_TRANSPORT_TESTING_Handle *tth; |
40 | 40 | ||
41 | static int ret = 0; | 41 | static int ret = 0; |
42 | 42 | ||
@@ -48,7 +48,7 @@ end () | |||
48 | if (timeout_task != NULL) | 48 | if (timeout_task != NULL) |
49 | GNUNET_SCHEDULER_cancel (timeout_task); | 49 | GNUNET_SCHEDULER_cancel (timeout_task); |
50 | 50 | ||
51 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); | 51 | GNUNET_TRANSPORT_TESTING_stop_peer (p); |
52 | GNUNET_TRANSPORT_TESTING_done (tth); | 52 | GNUNET_TRANSPORT_TESTING_done (tth); |
53 | } | 53 | } |
54 | 54 | ||
@@ -59,7 +59,7 @@ end_badly () | |||
59 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); | 59 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); |
60 | 60 | ||
61 | if (NULL != p) | 61 | if (NULL != p) |
62 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); | 62 | GNUNET_TRANSPORT_TESTING_stop_peer (p); |
63 | 63 | ||
64 | if (NULL != tth) | 64 | if (NULL != tth) |
65 | GNUNET_TRANSPORT_TESTING_done (tth); | 65 | GNUNET_TRANSPORT_TESTING_done (tth); |
@@ -69,7 +69,7 @@ end_badly () | |||
69 | 69 | ||
70 | 70 | ||
71 | static void | 71 | static void |
72 | start_cb (struct PeerContext *p, void *cls) | 72 | start_cb (struct GNUNET_TRANSPORT_TESTING_PeerContext *p, void *cls) |
73 | { | 73 | { |
74 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') successfully started\n", | 74 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') successfully started\n", |
75 | p->no, | 75 | p->no, |
@@ -89,13 +89,17 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
89 | GNUNET_assert (NULL != tth); | 89 | GNUNET_assert (NULL != tth); |
90 | 90 | ||
91 | timeout_task = | 91 | timeout_task = |
92 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &end_badly, NULL); | 92 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, |
93 | &end_badly, | ||
94 | NULL); | ||
93 | 95 | ||
94 | p = GNUNET_TRANSPORT_TESTING_start_peer(tth, cfgfile, 1, | 96 | p = GNUNET_TRANSPORT_TESTING_start_peer(tth, |
97 | cfgfile, | ||
98 | 1, | ||
95 | NULL, /* receive cb */ | 99 | NULL, /* receive cb */ |
96 | NULL, /* connect cb */ | 100 | NULL, /* connect cb */ |
97 | NULL, /* disconnect cb */ | 101 | NULL, /* disconnect cb */ |
98 | start_cb, /* startup cb */ | 102 | &start_cb, /* startup cb */ |
99 | NULL); /* closure */ | 103 | NULL); /* closure */ |
100 | if (NULL == p) | 104 | if (NULL == p) |
101 | { | 105 | { |