gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27693 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r27693 - gnunet/src/namestore
Date: Sun, 30 Jun 2013 21:46:53 +0200

Author: grothoff
Date: 2013-06-30 21:46:53 +0200 (Sun, 30 Jun 2013)
New Revision: 27693

Modified:
   gnunet/src/namestore/test_namestore_api_create_update.c
   gnunet/src/namestore/test_namestore_api_remove.c
   gnunet/src/namestore/test_namestore_api_zone_iteration.c
   gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
Log:
-fixing some namestore tests

Modified: gnunet/src/namestore/test_namestore_api_create_update.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_create_update.c     2013-06-30 
19:40:14 UTC (rev 27692)
+++ gnunet/src/namestore/test_namestore_api_create_update.c     2013-06-30 
19:46:53 UTC (rev 27693)
@@ -76,6 +76,7 @@
 static void
 endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+  GNUNET_break (0);
   if (nsh != NULL)
     GNUNET_NAMESTORE_disconnect (nsh);
   nsh = NULL;
@@ -136,8 +137,12 @@
 create_identical_cont (void *cls, int32_t success, const char *emsg)
 {
   char *name = cls;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating identical record for `%s': %s 
`%s'\n", name, ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" 
: "FAIL", emsg);
-  if (success == GNUNET_NO)
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Updating identical record for `%s': %s `%s'\n", 
+             name, 
+             ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" : 
"FAIL", 
+             emsg);
+  if (success == GNUNET_OK)
   {
     res = 0;
     s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value;
@@ -148,10 +153,13 @@
   else
   {
     res = 1;
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating identical record for `%s': 
%s `%s'\n", name, ((success == GNUNET_YES) || (success == GNUNET_NO)) ? 
"SUCCESS" : "FAIL", emsg);
-    GNUNET_SCHEDULER_add_now(&end, NULL);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 
+               "Updating identical record for `%s': %s `%s'\n", 
+               name, 
+               ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" 
: "FAIL", 
+               emsg);
+    GNUNET_SCHEDULER_add_now (&end, NULL);
   }
-
 }
 
 
@@ -159,7 +167,10 @@
 create_first_cont (void *cls, int32_t success, const char *emsg)
 {
   char *name = cls;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Create record for `%s': %s `%s'\n", 
name, (success == GNUNET_OK) ? "SUCCESS" : "FAIL", emsg);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Create record for `%s': %s `%s'\n",
+             name, (success == GNUNET_OK) ? "SUCCESS" : "FAIL", 
+             emsg);
   if (success == GNUNET_OK)
   {
     res = 0;
@@ -171,7 +182,8 @@
   else
   {
     res = 1;
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to put records for name 
`%s'\n", name);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "Failed to put records for name `%s'\n", name);
     GNUNET_SCHEDULER_add_now(&end, NULL);
   }
 
@@ -206,7 +218,7 @@
   char *hostkey_file;
   struct GNUNET_TIME_Absolute et;
 
-  endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
+  endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, endbadly, NULL);
 
   /* load privat key */
   GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,

Modified: gnunet/src/namestore/test_namestore_api_remove.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove.c    2013-06-30 19:40:14 UTC 
(rev 27692)
+++ gnunet/src/namestore/test_namestore_api_remove.c    2013-06-30 19:46:53 UTC 
(rev 27693)
@@ -118,12 +118,14 @@
 {
   static int found = GNUNET_NO;
   int failed = GNUNET_NO;
-  int c;
 
-  if (n != NULL)
+  if (NULL != n)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup for name `%s' returned %u 
records\n", n, rd_count);
-    if (0 != memcmp (zone_key, &pubkey, sizeof (struct 
GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "Lookup for name `%s' returned %u records\n", n, rd_count);
+    if (0 != memcmp (zone_key, 
+                    &pubkey,
+                    sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))
     {
       GNUNET_break (0);
       failed = GNUNET_YES;
@@ -135,27 +137,11 @@
       failed = GNUNET_YES;
     }
 
-    if (RECORDS-1 != rd_count)
+    if (0 != rd_count)
     {
       GNUNET_break (0);
       failed = GNUNET_YES;
     }
-
-    for (c = 0; c < rd_count; c++)
-    {
-      if (GNUNET_NO == GNUNET_NAMESTORE_records_cmp (&rd[c], &s_rd[c+1]))
-      {
-        GNUNET_break (0);
-        failed = GNUNET_YES;
-      }
-    }
-
-    if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey, expire, n, 
rd_count, rd, signature))
-    {
-      GNUNET_break (0);
-      failed = GNUNET_YES;
-    }
-
     if (failed == GNUNET_NO)
       res = 0;
     else

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-06-30 
19:40:14 UTC (rev 27692)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-06-30 
19:46:53 UTC (rev 27693)
@@ -227,11 +227,6 @@
         failed = GNUNET_YES;
         GNUNET_break (0);
       }
-      if (0 != memcmp (signature, sig_1, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-      {
-        failed = GNUNET_YES;
-        GNUNET_break (0);
-      }
     }
     else if (0 == strcmp (name, s_name_2))
     {
@@ -248,11 +243,6 @@
         failed = GNUNET_YES;
         GNUNET_break (0);
       }
-      if (0 != memcmp (signature, sig_2, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-      {
-        failed = GNUNET_YES;
-        GNUNET_break (0);
-      }
     }
     else if (0 == strcmp (name, s_name_3))
     {

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-06-30 19:40:14 UTC (rev 27692)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-06-30 19:46:53 UTC (rev 27693)
@@ -212,11 +212,6 @@
         failed = GNUNET_YES;
         GNUNET_break (0);
       }
-      if (0 != memcmp (signature, sig_1, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-      {
-        failed = GNUNET_YES;
-        GNUNET_break (0);
-      }
     }
     else if (0 == strcmp (name, s_name_2))
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]