diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/test_container_multihashmap.c | 6 | ||||
-rw-r--r-- | src/util/test_container_multipeermap.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c index bd193324c..a0ef8aa36 100644 --- a/src/util/test_container_multihashmap.c +++ b/src/util/test_container_multihashmap.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | 29 | ||
30 | #define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy(m); return 1; } | 30 | #define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy(m); if (NULL != iter) GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); return 1; } |
31 | #define CHECK(c) { if (! (c)) ABORT(); } | 31 | #define CHECK(c) { if (! (c)) ABORT(); } |
32 | 32 | ||
33 | static int | 33 | static int |
@@ -36,7 +36,7 @@ testMap (int i) | |||
36 | struct GNUNET_CONTAINER_MultiHashMap *m; | 36 | struct GNUNET_CONTAINER_MultiHashMap *m; |
37 | struct GNUNET_HashCode k1; | 37 | struct GNUNET_HashCode k1; |
38 | struct GNUNET_HashCode k2; | 38 | struct GNUNET_HashCode k2; |
39 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter; | 39 | struct GNUNET_CONTAINER_MultiHashMapIterator *iter = NULL; |
40 | struct GNUNET_HashCode key_ret; | 40 | struct GNUNET_HashCode key_ret; |
41 | const char *ret; | 41 | const char *ret; |
42 | int j; | 42 | int j; |
@@ -97,7 +97,7 @@ testMap (int i) | |||
97 | for (j = 0; j < GNUNET_CONTAINER_multihashmap_size (m); j++) | 97 | for (j = 0; j < GNUNET_CONTAINER_multihashmap_size (m); j++) |
98 | CHECK (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); | 98 | CHECK (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); |
99 | CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); | 99 | CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); |
100 | GNUNET_free (iter); | 100 | GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); |
101 | 101 | ||
102 | GNUNET_CONTAINER_multihashmap_destroy (m); | 102 | GNUNET_CONTAINER_multihashmap_destroy (m); |
103 | return 0; | 103 | return 0; |
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c index f121281fa..65bed6606 100644 --- a/src/util/test_container_multipeermap.c +++ b/src/util/test_container_multipeermap.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | 29 | ||
30 | #define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); return 1; } | 30 | #define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); if (NULL != iter) GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); return 1; } |
31 | #define CHECK(c) { if (! (c)) ABORT(); } | 31 | #define CHECK(c) { if (! (c)) ABORT(); } |
32 | 32 | ||
33 | static int | 33 | static int |
@@ -36,7 +36,7 @@ testMap (int i) | |||
36 | struct GNUNET_CONTAINER_MultiPeerMap *m; | 36 | struct GNUNET_CONTAINER_MultiPeerMap *m; |
37 | struct GNUNET_PeerIdentity k1; | 37 | struct GNUNET_PeerIdentity k1; |
38 | struct GNUNET_PeerIdentity k2; | 38 | struct GNUNET_PeerIdentity k2; |
39 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter; | 39 | struct GNUNET_CONTAINER_MultiPeerMapIterator *iter = NULL; |
40 | struct GNUNET_PeerIdentity key_ret; | 40 | struct GNUNET_PeerIdentity key_ret; |
41 | const char *ret; | 41 | const char *ret; |
42 | int j; | 42 | int j; |
@@ -97,7 +97,7 @@ testMap (int i) | |||
97 | for (j = 0; j < GNUNET_CONTAINER_multipeermap_size (m); j++) | 97 | for (j = 0; j < GNUNET_CONTAINER_multipeermap_size (m); j++) |
98 | CHECK (GNUNET_YES == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); | 98 | CHECK (GNUNET_YES == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); |
99 | CHECK (GNUNET_NO == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); | 99 | CHECK (GNUNET_NO == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); |
100 | GNUNET_free (iter); | 100 | GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); |
101 | 101 | ||
102 | GNUNET_CONTAINER_multipeermap_destroy (m); | 102 | GNUNET_CONTAINER_multipeermap_destroy (m); |
103 | return 0; | 103 | return 0; |