aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/test_service_rps_peers.c15
-rw-r--r--src/rps/test_service_rps_view.c3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/rps/test_service_rps_peers.c b/src/rps/test_service_rps_peers.c
index b9f1307a9e..43d9362009 100644
--- a/src/rps/test_service_rps_peers.c
+++ b/src/rps/test_service_rps_peers.c
@@ -57,9 +57,6 @@ check ()
CHECK (GNUNET_OK == CustomPeerMap_put (c_m, &k1));
CHECK (1 == CustomPeerMap_size (c_m));
- /*ret = GNUNET_CONTAINER_multipeermap_get (m, &k1);
- GNUNET_assert (ret != NULL);
- CHECK (0 == strcmp ("v1", ret));*/
CHECK (GNUNET_NO == CustomPeerMap_put (c_m, &k1));
CHECK (1 == CustomPeerMap_size (c_m));
CHECK (GNUNET_YES == CustomPeerMap_contains_peer (c_m, &k1));
@@ -69,12 +66,14 @@ check ()
CHECK (GNUNET_NO == CustomPeerMap_contains_peer (c_m, &k2));
CHECK (GNUNET_OK == CustomPeerMap_put (c_m, &k1));
+ CHECK (1 == CustomPeerMap_size (c_m));
for (j = 0; j < 16; j++)
{
CHECK (GNUNET_NO == CustomPeerMap_put (c_m, &k1));
}
CHECK (1 == CustomPeerMap_size (c_m));
CHECK (GNUNET_OK == CustomPeerMap_put (c_m, &k2));
+ CHECK (2 == CustomPeerMap_size (c_m));
for (j = 0; j < 16; j++)
{
CHECK (GNUNET_NO == CustomPeerMap_put (c_m, &k2));
@@ -96,6 +95,16 @@ check ()
CHECK (GNUNET_YES == CustomPeerMap_contains_peer (c_m, &k2));
CHECK (NULL != CustomPeerMap_get_peer_by_index (c_m, 0));
+ CustomPeerMap_clear (c_m);
+ CHECK (0 == CustomPeerMap_size (c_m));
+
+ CHECK (GNUNET_OK == CustomPeerMap_put (c_m, &k1));
+ CHECK (1 == CustomPeerMap_size (c_m));
+ CHECK (GNUNET_OK == CustomPeerMap_put (c_m, &k2));
+ CHECK (2 == CustomPeerMap_size (c_m));
+ CustomPeerMap_clear (c_m);
+ CHECK (0 == CustomPeerMap_size (c_m));
+
CustomPeerMap_destroy (c_m);
return 0;
diff --git a/src/rps/test_service_rps_view.c b/src/rps/test_service_rps_view.c
index f6be298506..9d2d371cd9 100644
--- a/src/rps/test_service_rps_view.c
+++ b/src/rps/test_service_rps_view.c
@@ -87,14 +87,17 @@ check ()
CHECK (GNUNET_NO == View_contains_peer (&k1));
CHECK (GNUNET_YES == View_contains_peer (&k2));
CHECK (NULL != View_get_peer_by_index (0));
+ CHECK (NULL == View_get_peer_by_index (1));
View_clear ();
CHECK (0 == View_size ());
CHECK (GNUNET_OK == View_put (&k1));
CHECK (1 == View_size ());
+ CHECK (GNUNET_YES == View_contains_peer (&k1));
CHECK (GNUNET_OK == View_put (&k2));
CHECK (2 == View_size ());
+ CHECK (GNUNET_YES == View_contains_peer (&k2));
array = View_get_as_array ();
CHECK (0 == memcmp (&array[0], &k1, sizeof (k1)));
CHECK (0 == memcmp (&array[1], &k2, sizeof (k2)));