diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
commit | 808ef8ab410b486c5cca7515389f608e965d53b1 (patch) | |
tree | 2a9476225227e3e550d95294db1c1b676bd23264 /src/namestore/test_namestore_api_remove.c | |
parent | 50114769c42140782b3955e416d61837fe570d0b (diff) | |
download | gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.tar.gz gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.zip |
-fixing testcases with new expiration code
Diffstat (limited to 'src/namestore/test_namestore_api_remove.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 1d57e70f9..85ecb4a29 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -214,21 +214,20 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
214 | 214 | ||
215 | 215 | ||
216 | static struct GNUNET_NAMESTORE_RecordData * | 216 | static struct GNUNET_NAMESTORE_RecordData * |
217 | create_record (int count) | 217 | create_record (unsigned int count) |
218 | { | 218 | { |
219 | int c; | 219 | unsigned int c; |
220 | struct GNUNET_NAMESTORE_RecordData * rd; | 220 | struct GNUNET_NAMESTORE_RecordData * rd; |
221 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
222 | 221 | ||
223 | rd[0].expiration = GNUNET_TIME_absolute_get(); | 222 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
223 | rd[0].expiration_time = GNUNET_TIME_absolute_get().abs_value; | ||
224 | rd[0].record_type = 0; | 224 | rd[0].record_type = 0; |
225 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; | 225 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; |
226 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); | 226 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); |
227 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 227 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
228 | 228 | for (c = 1; c < count; c++) | |
229 | for (c = 1; c < RECORDS; c++) | ||
230 | { | 229 | { |
231 | rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS; | 230 | rd[c].expiration_time = 0; |
232 | rd[c].record_type = TEST_RECORD_TYPE; | 231 | rd[c].record_type = TEST_RECORD_TYPE; |
233 | rd[c].data_size = TEST_RECORD_DATALEN; | 232 | rd[c].data_size = TEST_RECORD_DATALEN; |
234 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 233 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -245,6 +244,7 @@ run (void *cls, | |||
245 | { | 244 | { |
246 | size_t rd_ser_len; | 245 | size_t rd_ser_len; |
247 | char *hostkey_file; | 246 | char *hostkey_file; |
247 | struct GNUNET_TIME_Absolute et; | ||
248 | 248 | ||
249 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 249 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
250 | /* load privat key */ | 250 | /* load privat key */ |
@@ -266,7 +266,8 @@ run (void *cls, | |||
266 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 266 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
267 | 267 | ||
268 | /* sign */ | 268 | /* sign */ |
269 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 269 | et.abs_value = s_rd[0].expiration_time; |
270 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
270 | 271 | ||
271 | /* create random zone hash */ | 272 | /* create random zone hash */ |
272 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 273 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |