-more debug messages
[oweals/gnunet.git] / src / namestore / test_namestore_api_lookup_specific_type.c
index e2ac2588db3b6a97fc62e6fae9c59750937aab1a..26f037b00864e4df62ce2805ff564dec61947bbe 100644 (file)
@@ -18,7 +18,7 @@
      Boston, MA 02111-1307, USA.
 */
 /**
- * @file namestore/test_namestore_api.c
+ * @file namestore/test_namestore_api_lookup_sepecific_type.c
  * @brief testcase for namestore_api.c
  */
 #include "platform.h"
@@ -73,7 +73,7 @@ static void
 endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   if (nsh != NULL)
-    GNUNET_NAMESTORE_disconnect (nsh, GNUNET_YES);
+    GNUNET_NAMESTORE_disconnect (nsh);
   nsh = NULL;
   if (privkey != NULL)
     GNUNET_CRYPTO_rsa_key_free (privkey);
@@ -102,7 +102,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_CRYPTO_rsa_key_free (privkey);
   privkey = NULL;
   if (nsh != NULL)
-    GNUNET_NAMESTORE_disconnect (nsh, GNUNET_YES);
+    GNUNET_NAMESTORE_disconnect (nsh);
   nsh = NULL;
 }
 
@@ -246,21 +246,21 @@ put_cont (void *cls, int32_t success, const char *emsg)
 
 
 static struct GNUNET_NAMESTORE_RecordData *
-create_record (int count)
+create_record (unsigned int count)
 {
-  int c;
+  unsigned int c;
   struct GNUNET_NAMESTORE_RecordData * rd;
 
   rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
-  for (c = 0; c < RECORDS-1; c++)
+  for (c = 0; c < count-1; c++)
   {
-    rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS;
+    rd[c].expiration_time = 0;
     rd[c].record_type = 1;
     rd[c].data_size = TEST_RECORD_DATALEN;
     rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
     memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
   }
-  rd[c].expiration = GNUNET_TIME_absolute_get();
+  rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
   rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING;
   rd[c].data_size = TEST_RECORD_DATALEN;
   rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN);
@@ -272,10 +272,12 @@ create_record (int count)
 
 static void
 run (void *cls, 
-     const struct GNUNET_CONFIGURATION_Handle *cfg)
+     const struct GNUNET_CONFIGURATION_Handle *cfg,
+     struct GNUNET_TESTING_Peer *peer)
 {
   size_t rd_ser_len;
   char *hostkey_file;
+  struct GNUNET_TIME_Absolute et;
 
   endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
   /* load privat key */
@@ -298,7 +300,8 @@ run (void *cls,
     GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
 
     /* sign */
-    s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[RECORDS -1].expiration, s_name, s_rd, RECORDS);
+    et.abs_value = s_rd[RECORDS - 1].expiration_time;
+    s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS);
 
     /* create random zone hash */
     GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);