-export ecc generation function
[oweals/gnunet.git] / src / namestore / test_namestore_api_lookup_specific_type.c
index f53b152cc22700129e6d10ade5861949aa0660ed..4d2aa1cfe9090510a1a2018626458f76d67c0c65 100644 (file)
@@ -24,7 +24,7 @@
 #include "platform.h"
 #include "gnunet_common.h"
 #include "gnunet_namestore_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
 #include "namestore.h"
 #include "gnunet_signatures.h"
 
@@ -41,7 +41,7 @@
 
 #define TEST_RECORD_LOOKUP_TYPE_EXISTING 22222
 
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
 
 
 static struct GNUNET_NAMESTORE_Handle * nsh;
@@ -73,11 +73,12 @@ 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);
   privkey = NULL;
+  GNUNET_free_non_null (s_name);
   res = 1;
 }
 
@@ -97,12 +98,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_free_non_null((void *) s_rd[c].data);
   }
   GNUNET_free (s_rd);
-
+  GNUNET_free_non_null (s_name);
   if (privkey != NULL)
     GNUNET_CRYPTO_rsa_key_free (privkey);
   privkey = NULL;
   if (nsh != NULL)
-    GNUNET_NAMESTORE_disconnect (nsh, GNUNET_YES);
+    GNUNET_NAMESTORE_disconnect (nsh);
   nsh = NULL;
 }
 
@@ -140,11 +141,6 @@ name_lookup_existing_record_type (void *cls,
     GNUNET_break(0);
     failed = GNUNET_YES;
   }
-  if (NULL != signature)
-  {
-    GNUNET_break(0);
-    failed = GNUNET_YES;
-  }
   if (failed == GNUNET_YES)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore returned invalid response\n");
@@ -254,13 +250,13 @@ create_record (unsigned int count)
   rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
   for (c = 0; c < count-1; c++)
   {
-    rd[c].expiration_time = 0;
+    rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value;
     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_time = GNUNET_TIME_absolute_get().abs_value;
+  rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).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,7 +268,8 @@ create_record (unsigned 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;
@@ -290,7 +287,7 @@ run (void *cls,
   GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey);
 
   /* create record */
-  s_name = "dummy.dummy.gnunet";
+  s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet");
   s_rd = create_record (RECORDS);
 
   rd_ser_len = GNUNET_NAMESTORE_records_get_size(RECORDS, s_rd);