aboutsummaryrefslogtreecommitdiff
path: root/src/rps/test_rps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps/test_rps.c')
-rw-r--r--src/rps/test_rps.c19
1 files 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;
277typedef void (*InitPeer) (struct RPSPeer *rps_peer); 277typedef void (*InitPeer) (struct RPSPeer *rps_peer);
278 278
279/** 279/**
280 * Called directly after connecting to the service 280 * @brief Called directly after connecting to the service
281 *
282 * @param rps_peer Specific peer the function is called on
283 * @param h the handle to the rps service
281 */ 284 */
282typedef void (*PreTest) (void *cls, struct GNUNET_RPS_Handle *h); 285typedef void (*PreTest) (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h);
283 286
284/** 287/**
285 * @brief Executes functions to test the api/service for a given peer 288 * @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)
934 rps_peer->num_ids_to_request = 1; 937 rps_peer->num_ids_to_request = 1;
935} 938}
936 939
940
941/**
942 * @brief Set peers to (non-)malicious before execution
943 *
944 * Of signature #PreTest
945 *
946 * @param rps_peer the peer to set (non-) malicious
947 * @param h the handle to the service
948 */
937static void 949static void
938mal_pre (void *cls, struct GNUNET_RPS_Handle *h) 950mal_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
939{ 951{
940 #ifdef ENABLE_MALICIOUS 952 #ifdef ENABLE_MALICIOUS
941 uint32_t num_mal_peers; 953 uint32_t num_mal_peers;
942 struct RPSPeer *rps_peer = (struct RPSPeer *) cls;
943 954
944 GNUNET_assert ( (1 >= portion) && 955 GNUNET_assert ( (1 >= portion) &&
945 (0 < portion) ); 956 (0 < portion) );