diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-30 19:46:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-30 19:46:53 +0000 |
commit | 5685f97e7161d23d750b0cbb7b4edb25d8cf6ab6 (patch) | |
tree | 14f7a3257bbad75648ff9b03d51993f81fdc2bdd /src/namestore/test_namestore_api_remove.c | |
parent | c644917564f9a76b47b8c0d531e95020da9e282c (diff) | |
download | gnunet-5685f97e7161d23d750b0cbb7b4edb25d8cf6ab6.tar.gz gnunet-5685f97e7161d23d750b0cbb7b4edb25d8cf6ab6.zip |
-fixing some namestore tests
Diffstat (limited to 'src/namestore/test_namestore_api_remove.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index b40a935fd..498b3a360 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -118,12 +118,14 @@ name_lookup_proc (void *cls, | |||
118 | { | 118 | { |
119 | static int found = GNUNET_NO; | 119 | static int found = GNUNET_NO; |
120 | int failed = GNUNET_NO; | 120 | int failed = GNUNET_NO; |
121 | int c; | ||
122 | 121 | ||
123 | if (n != NULL) | 122 | if (NULL != n) |
124 | { | 123 | { |
125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup for name `%s' returned %u records\n", n, rd_count); | 124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
126 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) | 125 | "Lookup for name `%s' returned %u records\n", n, rd_count); |
126 | if (0 != memcmp (zone_key, | ||
127 | &pubkey, | ||
128 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) | ||
127 | { | 129 | { |
128 | GNUNET_break (0); | 130 | GNUNET_break (0); |
129 | failed = GNUNET_YES; | 131 | failed = GNUNET_YES; |
@@ -135,27 +137,11 @@ name_lookup_proc (void *cls, | |||
135 | failed = GNUNET_YES; | 137 | failed = GNUNET_YES; |
136 | } | 138 | } |
137 | 139 | ||
138 | if (RECORDS-1 != rd_count) | 140 | if (0 != rd_count) |
139 | { | ||
140 | GNUNET_break (0); | ||
141 | failed = GNUNET_YES; | ||
142 | } | ||
143 | |||
144 | for (c = 0; c < rd_count; c++) | ||
145 | { | ||
146 | if (GNUNET_NO == GNUNET_NAMESTORE_records_cmp (&rd[c], &s_rd[c+1])) | ||
147 | { | ||
148 | GNUNET_break (0); | ||
149 | failed = GNUNET_YES; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey, expire, n, rd_count, rd, signature)) | ||
154 | { | 141 | { |
155 | GNUNET_break (0); | 142 | GNUNET_break (0); |
156 | failed = GNUNET_YES; | 143 | failed = GNUNET_YES; |
157 | } | 144 | } |
158 | |||
159 | if (failed == GNUNET_NO) | 145 | if (failed == GNUNET_NO) |
160 | res = 0; | 146 | res = 0; |
161 | else | 147 | else |