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_zone_iteration.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_zone_iteration.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 9a2c2d0ab..4e4ff88bc 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -345,15 +345,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
345 | 345 | ||
346 | 346 | ||
347 | static struct GNUNET_NAMESTORE_RecordData * | 347 | static struct GNUNET_NAMESTORE_RecordData * |
348 | create_record (int count) | 348 | create_record (unsigned int count) |
349 | { | 349 | { |
350 | int c; | 350 | unsigned int c; |
351 | struct GNUNET_NAMESTORE_RecordData * rd; | 351 | struct GNUNET_NAMESTORE_RecordData * rd; |
352 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
353 | 352 | ||
353 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
354 | for (c = 0; c < count; c++) | 354 | for (c = 0; c < count; c++) |
355 | { | 355 | { |
356 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 356 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
357 | rd[c].record_type = 1111; | 357 | rd[c].record_type = 1111; |
358 | rd[c].data_size = 50; | 358 | rd[c].data_size = 50; |
359 | rd[c].data = GNUNET_malloc(50); | 359 | rd[c].data = GNUNET_malloc(50); |
@@ -368,6 +368,7 @@ run (void *cls, | |||
368 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 368 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
369 | { | 369 | { |
370 | char *hostkey_file; | 370 | char *hostkey_file; |
371 | struct GNUNET_TIME_Absolute et; | ||
371 | 372 | ||
372 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); | 373 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); |
373 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 374 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
@@ -396,7 +397,8 @@ run (void *cls, | |||
396 | 397 | ||
397 | GNUNET_asprintf(&s_name_1, "dummy1"); | 398 | GNUNET_asprintf(&s_name_1, "dummy1"); |
398 | s_rd_1 = create_record(1); | 399 | s_rd_1 = create_record(1); |
399 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1->expiration, s_name_1, s_rd_1, 1); | 400 | et.abs_value = s_rd_1->expiration_time; |
401 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | ||
400 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); | 402 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); |
401 | 403 | ||
402 | 404 | ||
@@ -404,14 +406,16 @@ run (void *cls, | |||
404 | GNUNET_asprintf(&s_name_2, "dummy2"); | 406 | GNUNET_asprintf(&s_name_2, "dummy2"); |
405 | s_rd_2 = create_record(1); | 407 | s_rd_2 = create_record(1); |
406 | 408 | ||
407 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2->expiration, s_name_2, s_rd_2, 1); | 409 | et.abs_value = s_rd_2->expiration_time; |
410 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | ||
408 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); | 411 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); |
409 | 412 | ||
410 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); | 413 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); |
411 | /* name in different zone */ | 414 | /* name in different zone */ |
412 | GNUNET_asprintf(&s_name_3, "dummy3"); | 415 | GNUNET_asprintf(&s_name_3, "dummy3"); |
413 | s_rd_3 = create_record(1); | 416 | s_rd_3 = create_record(1); |
414 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3->expiration, s_name_3, s_rd_3, 1); | 417 | et.abs_value = s_rd_3->expiration_time; |
418 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | ||
415 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 419 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
416 | } | 420 | } |
417 | 421 | ||