aboutsummaryrefslogtreecommitdiff
path: root/src/psyc/test_psyc.c
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-12-24 13:25:41 +0100
committerlurchi <lurchi@strangeplace.net>2017-12-24 13:28:02 +0100
commit1e0f7ee75e5c6123916b70a870c81e4f56671437 (patch)
tree44b7d6c0747efe41cabb2b829a65ceec9ee2fb94 /src/psyc/test_psyc.c
parent804c401123f78873678a8553503e14ab434e9983 (diff)
be more clear about test procedure (use self-explanatory function names)
Diffstat (limited to 'src/psyc/test_psyc.c')
-rw-r--r--src/psyc/test_psyc.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c
index 03a1890b1f..370befb9df 100644
--- a/src/psyc/test_psyc.c
+++ b/src/psyc/test_psyc.c
@@ -755,15 +755,22 @@ 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);