From 875ed6d7e948fb57959929f9079c5a160ca04c42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Sun, 7 Jan 2018 22:09:35 +0100 Subject: [PATCH] rps tests: change function signature, comments --- src/rps/test_rps.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 0268ff438..584d26c26 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -277,9 +277,12 @@ static struct GNUNET_SCHEDULER_Task *churn_task; typedef void (*InitPeer) (struct RPSPeer *rps_peer); /** - * Called directly after connecting to the service + * @brief Called directly after connecting to the service + * + * @param rps_peer Specific peer the function is called on + * @param h the handle to the rps service */ -typedef void (*PreTest) (void *cls, struct GNUNET_RPS_Handle *h); +typedef void (*PreTest) (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h); /** * @brief Executes functions to test the api/service for a given peer @@ -934,12 +937,20 @@ static void mal_init_peer (struct RPSPeer *rps_peer) rps_peer->num_ids_to_request = 1; } + +/** + * @brief Set peers to (non-)malicious before execution + * + * Of signature #PreTest + * + * @param rps_peer the peer to set (non-) malicious + * @param h the handle to the service + */ static void -mal_pre (void *cls, struct GNUNET_RPS_Handle *h) +mal_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) { #ifdef ENABLE_MALICIOUS uint32_t num_mal_peers; - struct RPSPeer *rps_peer = (struct RPSPeer *) cls; GNUNET_assert ( (1 >= portion) && (0 < portion) ); -- 2.25.1