aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-14 10:04:13 +0200
committerJulius Bünger <buenger@mytum.de>2018-10-14 10:04:13 +0200
commit6ebd7d015990554594f5668cdccc4fe2da629fbf (patch)
tree3f0c97c4f84da20df57478900899e4856f8d6da1 /src
parent7d80f6afad280f3dd76877a1dc80c67923a751b5 (diff)
downloadgnunet-6ebd7d015990554594f5668cdccc4fe2da629fbf.tar.gz
gnunet-6ebd7d015990554594f5668cdccc4fe2da629fbf.zip
RPS test: Add another group for sub test
Diffstat (limited to 'src')
-rw-r--r--src/rps/test_rps.c11
1 files changed, 11 insertions, 0 deletions
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,
1578 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Received a peer id outside sub\n"); 1578 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Received a peer id outside sub\n");
1579 ok = 1; 1579 ok = 1;
1580 } 1580 }
1581 else if (0 == rps_peer->index &&
1582 0 != memcmp (&peers[i],
1583 &rps_peers[0].peer_id,
1584 sizeof (struct GNUNET_PeerIdentity)))
1585 {
1586 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Received a peer id outside sub (lonely)\n");
1587 ok = 1;
1588 }
1581 } 1589 }
1582} 1590}
1583 1591
@@ -1586,14 +1594,17 @@ static void
1586sub_post (struct RPSPeer *rps_peer) 1594sub_post (struct RPSPeer *rps_peer)
1587{ 1595{
1588 if (0 != rps_peer->index) GNUNET_RPS_sub_stop (rps_peer->rps_handle, "test"); 1596 if (0 != rps_peer->index) GNUNET_RPS_sub_stop (rps_peer->rps_handle, "test");
1597 else GNUNET_RPS_sub_stop (rps_peer->rps_handle, "lonely");
1589} 1598}
1590 1599
1600
1591static void 1601static void
1592sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) 1602sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
1593{ 1603{
1594 (void) rps_peer; 1604 (void) rps_peer;
1595 1605
1596 if (0 != rps_peer->index) GNUNET_RPS_sub_start (h, "test"); 1606 if (0 != rps_peer->index) GNUNET_RPS_sub_start (h, "test");
1607 else GNUNET_RPS_sub_start (h, "lonely"); /* have a group of one */
1597 rps_peer->rps_srh = GNUNET_RPS_stream_request (h, 1608 rps_peer->rps_srh = GNUNET_RPS_stream_request (h,
1598 0, 1609 0,
1599 &got_stream_peer_cb, 1610 &got_stream_peer_cb,