From 5511ea2d4ce4e62120528272881b477ca6f6877c Mon Sep 17 00:00:00 2001 From: Julius Bünger Date: Sun, 7 Jan 2018 22:10:21 +0100 Subject: rps tests: sanity checks and cosmetics --- src/rps/test_rps.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 584d26c26..9f3044dcc 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -1181,7 +1181,7 @@ churn_cb (void *cls, num_peers_online += entry->delta; - if (0 > entry->delta) + if (-1 == entry->delta) { /* Peer hopefully just went offline */ if (GNUNET_YES != rps_peers[entry->index].online) { @@ -1222,6 +1222,12 @@ churn_cb (void *cls, } rps_peers[entry->index].online = GNUNET_YES; } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Invalid value for delta: %i\n", entry->delta); + GNUNET_break (0); + } GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry); rps_peers[entry->index].entry_op_manage = NULL; @@ -1743,10 +1749,10 @@ main (int argc, char *argv[]) ok = 1; ret_value = GNUNET_TESTBED_test_run (cur_test_run.name, - "test_rps.conf", - num_peers, - 0, NULL, NULL, - &run, NULL); + "test_rps.conf", + num_peers, + 0, NULL, NULL, + &run, NULL); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "_test_run returned.\n"); if (GNUNET_OK != ret_value) -- cgit v1.2.3