X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Frps%2Ftest_rps.c;h=92d8c12ea5a1ae46ccbe826d75542e01def01932;hb=7a5a724a6f96baf80d2226326124aa01c58ad3fe;hp=39aeacfebc768382d51242e0a416c6c599617149;hpb=d15b9286cbaa6f56299f9064d269d3a1aa1ddee4;p=oweals%2Fgnunet.git diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 39aeacfeb..92d8c12ea 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2012 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ /** * @file rps/test_rps.c @@ -843,6 +841,13 @@ seed_peers (void *cls) unsigned int amount; unsigned int i; + if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) + { + return; + } + + GNUNET_assert (NULL != peer->rps_handle); + // TODO if malicious don't seed mal peers amount = round (.5 * num_peers); @@ -955,6 +960,8 @@ rps_connect_complete_cb (void *cls, struct RPSPeer *rps_peer = cls; struct GNUNET_RPS_Handle *rps = ca_result; + GNUNET_assert (NULL != ca_result); + if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) { return; @@ -998,9 +1005,11 @@ rps_connect_adapter (void *cls, struct GNUNET_RPS_Handle *h; h = GNUNET_RPS_connect (cfg); + GNUNET_assert (NULL != h); if (NULL != cur_test_run.pre_test) cur_test_run.pre_test (cls, h); + GNUNET_assert (NULL != h); return h; } @@ -2841,7 +2850,7 @@ main (int argc, char *argv[]) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n"); cur_test_run.name = "test-rps-profiler"; - num_peers = 100; + num_peers = 16; mal_type = 3; cur_test_run.init_peer = profiler_init_peer; //cur_test_run.pre_test = mal_pre; @@ -2907,6 +2916,7 @@ main (int argc, char *argv[]) } ret_value = cur_test_run.eval_cb(); + if (NO_COLLECT_VIEW == cur_test_run.have_collect_view) { GNUNET_array_grow (rps_peers->cur_view,