diff options
author | ch3 <ch3@140774ce-b5e7-0310-ab8b-a85725594a96> | 2015-11-30 23:06:12 +0000 |
---|---|---|
committer | ch3 <ch3@140774ce-b5e7-0310-ab8b-a85725594a96> | 2015-11-30 23:06:12 +0000 |
commit | 8ac94742c5f3dcb10bb6d19ff810fdf65b3176ce (patch) | |
tree | 63289191fa5bb216cfb48ea0371776dd069ad98c | |
parent | 7a3341179b9bb86774f10fd0891334c8c5e7c2d6 (diff) |
-added test of _change_len() to test of "view"
Signed-off-by: Julius Bünger <buenger@mytum.de>
git-svn-id: https://gnunet.org/svn/gnunet@36701 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/rps/test_service_rps_view.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rps/test_service_rps_view.c b/src/rps/test_service_rps_view.c index 9d2d371cd9..68d1b11d41 100644 --- a/src/rps/test_service_rps_view.c +++ b/src/rps/test_service_rps_view.c @@ -105,6 +105,24 @@ check () CHECK (0 == View_size ()); /*View_change_len () */ + CHECK (GNUNET_OK == View_put (&k1)); + CHECK (GNUNET_OK == View_put (&k2)); + CHECK (2 == View_size ()); + View_change_len (4); + CHECK (2 == View_size ()); + CHECK (GNUNET_YES == View_contains_peer (&k1)); + 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))); + View_change_len (1); + CHECK (1 == View_size ()); + CHECK (GNUNET_YES == View_contains_peer (&k1)); + CHECK (GNUNET_NO == View_contains_peer (&k2)); + array = View_get_as_array (); + CHECK (0 == memcmp (&array[0], &k1, sizeof (k1))); + View_clear (); + CHECK (0 == View_size ()); View_destroy (); |