Returns now GNUNET_SYSERR
[oweals/gnunet.git] / src / util / test_container_multihashmap.c
index e92ab49ba133e4101954db1e54fd463744fb6a6d..931a52fece0de51fdd4b55e8de99dfd12376e500 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -37,8 +37,8 @@ testMap (int i)
   struct GNUNET_CONTAINER_MultiHashMap *m;
   GNUNET_HashCode k1;
   GNUNET_HashCode k2;
+  const char *ret;
   int j;
-  void *r;
 
   CHECK (NULL != (m = GNUNET_CONTAINER_multihashmap_create (i)));
   memset (&k1, 0, sizeof (k1));
@@ -60,7 +60,9 @@ testMap (int i)
                                                          "v1",
                                                          GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
   CHECK (1 == GNUNET_CONTAINER_multihashmap_size (m));
-  CHECK (0 == strcmp ("v1", GNUNET_CONTAINER_multihashmap_get (m, &k1)));
+  ret = GNUNET_CONTAINER_multihashmap_get (m, &k1);
+  GNUNET_assert (ret != NULL);
+  CHECK (0 == strcmp ("v1", ret));
   CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_put (m,
                                                          &k1,
                                                          "v1",
@@ -84,8 +86,6 @@ testMap (int i)
   CHECK (0 ==
          GNUNET_CONTAINER_multihashmap_get_multiple (m, &k2, NULL, NULL));
   CHECK (2 == GNUNET_CONTAINER_multihashmap_iterate (m, NULL, NULL));
-  r = GNUNET_CONTAINER_multihashmap_get_random (m);
-  CHECK (0 == strcmp (r, "v1") || 0 == strcmp (r, "v2"));
   CHECK (2 == GNUNET_CONTAINER_multihashmap_remove_all (m, &k1));
   for (j = 0; j < 1024; j++)
     CHECK (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (m,
@@ -110,4 +110,4 @@ main (int argc, char *argv[])
   return 0;
 }
 
-/* end of maptest.c */
+/* end of test_container_multihashmap.c */