From: Julius Bünger Date: Sun, 14 Oct 2018 08:04:13 +0000 (+0200) Subject: RPS test: Add another group for sub test X-Git-Tag: v0.11.0~238^2~71 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6ebd7d015990554594f5668cdccc4fe2da629fbf;p=oweals%2Fgnunet.git RPS test: Add another group for sub test --- diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index f26a9d424..1c98a1e5e 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -1578,6 +1578,14 @@ got_stream_peer_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Received a peer id outside sub\n"); ok = 1; } + else if (0 == rps_peer->index && + 0 != memcmp (&peers[i], + &rps_peers[0].peer_id, + sizeof (struct GNUNET_PeerIdentity))) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Received a peer id outside sub (lonely)\n"); + ok = 1; + } } } @@ -1586,14 +1594,17 @@ static void sub_post (struct RPSPeer *rps_peer) { if (0 != rps_peer->index) GNUNET_RPS_sub_stop (rps_peer->rps_handle, "test"); + else GNUNET_RPS_sub_stop (rps_peer->rps_handle, "lonely"); } + static void sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) { (void) rps_peer; if (0 != rps_peer->index) GNUNET_RPS_sub_start (h, "test"); + else GNUNET_RPS_sub_start (h, "lonely"); /* have a group of one */ rps_peer->rps_srh = GNUNET_RPS_stream_request (h, 0, &got_stream_peer_cb,