From 6ebd7d015990554594f5668cdccc4fe2da629fbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Sun, 14 Oct 2018 10:04:13 +0200 Subject: [PATCH] RPS test: Add another group for sub test --- src/rps/test_rps.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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, -- 2.25.1