aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_peerstartup2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/test_testing_peerstartup2.c')
-rw-r--r--src/testing/test_testing_peerstartup2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index 8bc6396d3..a4bdd4d65 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file testing/test_testing_new_peerstartup.c 22 * @file testing/test_testing_new_peerstartup.c
23 * @brief test case for testing peer startup and shutdown using new testing 23 * @brief test case for testing peer startup and shutdown using new testing
24 * library 24 * library
25 * @author Sree Harsha Totakura 25 * @author Sree Harsha Totakura
26 */ 26 */
27 27
@@ -42,7 +42,7 @@
42 } \ 42 } \
43 } \ 43 } \
44 } while (0) \ 44 } while (0) \
45 45
46 46
47/** 47/**
48 * The status of the test 48 * The status of the test
@@ -58,7 +58,7 @@ struct TestingContext
58 * The testing system 58 * The testing system
59 */ 59 */
60 struct GNUNET_TESTING_System *system; 60 struct GNUNET_TESTING_System *system;
61 61
62 /** 62 /**
63 * The peer which has been started by the testing system 63 * The peer which has been started by the testing system
64 */ 64 */
@@ -94,7 +94,7 @@ do_shutdown2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
94 if (NULL != test_ctx->system) 94 if (NULL != test_ctx->system)
95 GNUNET_TESTING_system_destroy (test_ctx->system, GNUNET_YES); 95 GNUNET_TESTING_system_destroy (test_ctx->system, GNUNET_YES);
96 GNUNET_free (test_ctx); 96 GNUNET_free (test_ctx);
97 97
98} 98}
99 99
100 100
@@ -143,7 +143,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143 GNUNET_assert (NULL != test_ctx); 143 GNUNET_assert (NULL != test_ctx);
144 if (NULL != test_ctx->peer) 144 if (NULL != test_ctx->peer)
145 { 145 {
146 FAIL_TEST (GNUNET_OK == 146 FAIL_TEST (GNUNET_OK ==
147 GNUNET_TESTING_peer_stop_async (test_ctx->peer, 147 GNUNET_TESTING_peer_stop_async (test_ctx->peer,
148 &peer_status_cb, 148 &peer_status_cb,
149 test_ctx)); 149 test_ctx));
@@ -165,14 +165,14 @@ run (void *cls, char *const *args, const char *cfgfile,
165 struct GNUNET_PeerIdentity id; 165 struct GNUNET_PeerIdentity id;
166 166
167 test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); 167 test_ctx = GNUNET_malloc (sizeof (struct TestingContext));
168 test_ctx->system = 168 test_ctx->system =
169 GNUNET_TESTING_system_create ("test-gnunet-testing", 169 GNUNET_TESTING_system_create ("test-gnunet-testing",
170 "127.0.0.1", NULL, NULL); 170 "127.0.0.1", NULL, NULL);
171 emsg = NULL; 171 emsg = NULL;
172 if (NULL == test_ctx->system) 172 if (NULL == test_ctx->system)
173 goto end; 173 goto end;
174 test_ctx->cfg = GNUNET_CONFIGURATION_dup (cfg); 174 test_ctx->cfg = GNUNET_CONFIGURATION_dup (cfg);
175 test_ctx->peer = 175 test_ctx->peer =
176 GNUNET_TESTING_peer_configure (test_ctx->system, 176 GNUNET_TESTING_peer_configure (test_ctx->system,
177 test_ctx->cfg, 177 test_ctx->cfg,
178 0, &id, &emsg); 178 0, &id, &emsg);
@@ -185,7 +185,7 @@ run (void *cls, char *const *args, const char *cfgfile,
185 if (GNUNET_OK != GNUNET_TESTING_peer_start (test_ctx->peer)) 185 if (GNUNET_OK != GNUNET_TESTING_peer_start (test_ctx->peer))
186 goto end; 186 goto end;
187 test_ctx->state = PEER_STARTED; 187 test_ctx->state = PEER_STARTED;
188 FAIL_TEST (GNUNET_OK == 188 FAIL_TEST (GNUNET_OK ==
189 GNUNET_TESTING_peer_stop_async (test_ctx->peer, 189 GNUNET_TESTING_peer_stop_async (test_ctx->peer,
190 &peer_status_cb, 190 &peer_status_cb,
191 test_ctx)); 191 test_ctx));
@@ -193,7 +193,7 @@ run (void *cls, char *const *args, const char *cfgfile,
193 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 193 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
194 &do_shutdown, test_ctx); 194 &do_shutdown, test_ctx);
195 return; 195 return;
196 196
197 end: 197 end:
198 FAIL_TEST (0); 198 FAIL_TEST (0);
199 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); 199 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx);