From: lurchi Date: Sun, 24 Dec 2017 12:25:41 +0000 (+0100) Subject: be more clear about test procedure (use self-explanatory function names) X-Git-Tag: gnunet-0.11.0rc0~48^2~1^2~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1e0f7ee75e5c6123916b70a870c81e4f56671437;p=oweals%2Fgnunet.git be more clear about test procedure (use self-explanatory function names) --- diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c index 03a1890b1..370befb9d 100644 --- a/src/psyc/test_psyc.c +++ b/src/psyc/test_psyc.c @@ -754,16 +754,23 @@ slave_add () } +static void +schedule_second_slave_join (void *cls) +{ + slave_join (TEST_SLAVE_JOIN_ACCEPT); +} + + static void first_slave_parted (void *cls) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "First slave parted.\n"); - slave_join (TEST_SLAVE_JOIN_ACCEPT); + GNUNET_SCHEDULER_add_now (&schedule_second_slave_join, NULL); } static void -schedule_slave_part (void *cls) +schedule_first_slave_part (void *cls) { GNUNET_PSYC_slave_part (slv, GNUNET_NO, &first_slave_parted, NULL); } @@ -783,7 +790,7 @@ join_decision_cb (void *cls, case TEST_SLAVE_JOIN_REJECT: GNUNET_assert (0 == is_admitted); GNUNET_assert (1 == join_req_count); - GNUNET_SCHEDULER_add_now (&schedule_slave_part, NULL); + GNUNET_SCHEDULER_add_now (&schedule_first_slave_part, NULL); break; case TEST_SLAVE_JOIN_ACCEPT: @@ -844,11 +851,18 @@ slave_join (int t) struct GNUNET_PSYC_Message * join_msg = GNUNET_PSYC_message_create ("_request_join", env, "some data", 9); - slv = GNUNET_PSYC_slave_join (cfg, &channel_pub_key, slave_key, + slv = GNUNET_PSYC_slave_join (cfg, + &channel_pub_key, + slave_key, GNUNET_PSYC_SLAVE_JOIN_NONE, - &origin, 0, NULL, - &slave_message_cb, &slave_message_part_cb, - &slave_connect_cb, &join_decision_cb, NULL, + &origin, + 0, + NULL, + &slave_message_cb, + &slave_message_part_cb, + &slave_connect_cb, + &join_decision_cb, + NULL, join_msg); GNUNET_free (join_msg); slv_chn = GNUNET_PSYC_slave_get_channel (slv);