diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-05 08:41:25 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-05 08:41:25 +0000 |
commit | 66bf141fbc0def4691b3204ec6985008d52acef4 (patch) | |
tree | ae784979c4c68df8ade6ad50cda6bc1289738cef /src/namestore/test_namestore_api_lookup_shadow.c | |
parent | ad8ed315dca32a5de2af97bfda96c6199c565722 (diff) | |
download | gnunet-66bf141fbc0def4691b3204ec6985008d52acef4.tar.gz gnunet-66bf141fbc0def4691b3204ec6985008d52acef4.zip |
fix tests and do not assert since this will break make check
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_shadow.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_shadow.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c index 2c614998f..442d3eb1c 100644 --- a/src/namestore/test_namestore_api_lookup_shadow.c +++ b/src/namestore/test_namestore_api_lookup_shadow.c | |||
@@ -20,6 +20,8 @@ | |||
20 | /** | 20 | /** |
21 | * @file namestore/test_namestore_api_lookup_shadow_filter.c | 21 | * @file namestore/test_namestore_api_lookup_shadow_filter.c |
22 | * @brief testcase for namestore_api.c: store a shadow record and perform a lookup | 22 | * @brief testcase for namestore_api.c: store a shadow record and perform a lookup |
23 | * test passes if test returns the record but without the shadow flag since no | ||
24 | * other valid record is available | ||
23 | */ | 25 | */ |
24 | #include "platform.h" | 26 | #include "platform.h" |
25 | #include "gnunet_namecache_service.h" | 27 | #include "gnunet_namecache_service.h" |
@@ -127,10 +129,30 @@ rd_decrypt_cb (void *cls, | |||
127 | } | 129 | } |
128 | memset (rd_cmp_data, 'a', TEST_RECORD_DATALEN); | 130 | memset (rd_cmp_data, 'a', TEST_RECORD_DATALEN); |
129 | 131 | ||
130 | GNUNET_assert (TEST_RECORD_TYPE == rd[0].record_type); | 132 | if (TEST_RECORD_TYPE != rd[0].record_type) |
131 | GNUNET_assert (TEST_RECORD_DATALEN == rd[0].data_size); | 133 | { |
132 | GNUNET_assert (0 == memcmp (&rd_cmp_data, rd[0].data, TEST_RECORD_DATALEN)); | 134 | GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
133 | GNUNET_assert (GNUNET_GNSRECORD_RF_SHADOW_RECORD == rd[0].flags); | 135 | GNUNET_break (0); |
136 | return; | ||
137 | } | ||
138 | if (TEST_RECORD_DATALEN != rd[0].data_size) | ||
139 | { | ||
140 | GNUNET_SCHEDULER_add_now (&endbadly, NULL); | ||
141 | GNUNET_break (0); | ||
142 | return; | ||
143 | } | ||
144 | if (0 != memcmp (&rd_cmp_data, rd[0].data, TEST_RECORD_DATALEN)) | ||
145 | { | ||
146 | GNUNET_SCHEDULER_add_now (&endbadly, NULL); | ||
147 | GNUNET_break (0); | ||
148 | return; | ||
149 | } | ||
150 | if (0 != (GNUNET_GNSRECORD_RF_SHADOW_RECORD & rd[0].flags)) | ||
151 | { | ||
152 | GNUNET_SCHEDULER_add_now (&endbadly, NULL); | ||
153 | GNUNET_break (0); | ||
154 | return; | ||
155 | } | ||
134 | 156 | ||
135 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
136 | "Block was decrypted successfully \n"); | 158 | "Block was decrypted successfully \n"); |
@@ -215,7 +237,6 @@ run (void *cls, | |||
215 | GNUNET_assert (privkey != NULL); | 237 | GNUNET_assert (privkey != NULL); |
216 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); | 238 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); |
217 | 239 | ||
218 | |||
219 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000; | 240 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000; |
220 | rd.record_type = TEST_RECORD_TYPE; | 241 | rd.record_type = TEST_RECORD_TYPE; |
221 | rd.data_size = TEST_RECORD_DATALEN; | 242 | rd.data_size = TEST_RECORD_DATALEN; |
@@ -234,7 +255,6 @@ run (void *cls, | |||
234 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 255 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
235 | _("Namestore cannot store no block\n")); | 256 | _("Namestore cannot store no block\n")); |
236 | } | 257 | } |
237 | |||
238 | GNUNET_free ((void *)rd.data); | 258 | GNUNET_free ((void *)rd.data); |
239 | } | 259 | } |
240 | 260 | ||