diff options
author | Julius Bünger <buenger@mytum.de> | 2015-11-30 23:06:12 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-11-30 23:06:12 +0000 |
commit | f712350713dc85fdea3e844220c90e646641e422 (patch) | |
tree | 63289191fa5bb216cfb48ea0371776dd069ad98c | |
parent | c9471a7341d3caa16311e6d06d36010bc4267cab (diff) |
-added test of _change_len() to test of "view"
Signed-off-by: Julius Bünger <buenger@mytum.de>
-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 (); |