From: Sree Harsha Totakura Date: Tue, 28 Jul 2015 15:29:19 +0000 (+0000) Subject: more assertions X-Git-Tag: initial-import-from-subversion-38251~1575 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=01a62e8e969eb749a850e6425e32cd7ef269ee9e;p=oweals%2Fgnunet.git more assertions --- diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index f0393bdf0..71903709a 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -410,7 +410,7 @@ static struct GNUNET_CONTAINER_MultiPeerMap *mal_peer_set = NULL; /** * Number of other malicious peers */ -static uint32_t num_mal_peers = 0; +static uint32_t num_mal_peers; /** @@ -1288,6 +1288,7 @@ void client_respond (void *cls, uint32_t size_needed; struct ClientContext *cli_ctx; + GNUNET_assert (NULL != reply_cls); LOG (GNUNET_ERROR_TYPE_DEBUG, "sampler returned %" PRIu32 " peers:\n", num_peers); @@ -1415,6 +1416,7 @@ handle_client_seed (void *cls, GNUNET_break_op (0); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); + return; } LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -1989,6 +1991,7 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type %" PRIu32 ".\n", mal_type); + GNUNET_assert (mal_type <= 3); /* Do malicious actions */ if (1 == mal_type) { /* Try to maximise representation */ diff --git a/src/rps/rps.h b/src/rps/rps.h index e1583d06c..9a16e7593 100644 --- a/src/rps/rps.h +++ b/src/rps/rps.h @@ -154,7 +154,8 @@ struct GNUNET_RPS_CS_ActMaliciousMessage */ uint32_t num_peers GNUNET_PACKED; - /* Followed by num_peers * GNUNET_PeerIdentity */ + /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious + behaviour is 1 */ }; #endif /* ENABLE_MALICIOUS */ diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index a430f4a83..108c1bd34 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -1147,18 +1147,14 @@ run (void *cls, rps_peers[i].index = i; rps_peers[i].op = GNUNET_TESTBED_service_connect (&rps_peers[i], - peers[i], - "rps", - &rps_connect_complete_cb, - &rps_peers[i], - &rps_connect_adapter, - &rps_disconnect_adapter, - &rps_peers[i]); + peers[i], + "rps", + &rps_connect_complete_cb, + &rps_peers[i], + &rps_connect_adapter, + &rps_disconnect_adapter, + &rps_peers[i]); } - - if (NULL != churn_task) - GNUNET_SCHEDULER_cancel (churn_task); - GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); }