gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22260 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r22260 - gnunet/src/gns
Date: Mon, 25 Jun 2012 01:32:15 +0200

Author: schanzen
Date: 2012-06-25 01:32:15 +0200 (Mon, 25 Jun 2012)
New Revision: 22260

Modified:
   gnunet/src/gns/test_gns_pseu_shorten.c
   gnunet/src/gns/test_gns_simple_mx_lookup.c
   gnunet/src/gns/test_gns_simple_srv_lookup.c
Log:
-test cleanup

Modified: gnunet/src/gns/test_gns_pseu_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_pseu_shorten.c      2012-06-24 22:01:52 UTC (rev 
22259)
+++ gnunet/src/gns/test_gns_pseu_shorten.c      2012-06-24 23:32:15 UTC (rev 
22260)
@@ -37,7 +37,7 @@
 #define VERBOSE GNUNET_YES
 
 /* Timeout for entire testcase */
-#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5)
+#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)
 
 /* If number of peers not in config file, use this number */
 #define DEFAULT_NUM_PEERS 2

Modified: gnunet/src/gns/test_gns_simple_mx_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_mx_lookup.c  2012-06-24 22:01:52 UTC (rev 
22259)
+++ gnunet/src/gns/test_gns_simple_mx_lookup.c  2012-06-24 23:32:15 UTC (rev 
22260)
@@ -93,11 +93,7 @@
 on_lookup_result(void *cls, uint32_t rd_count,
                  const struct GNUNET_NAMESTORE_RecordData *rd)
 {
-  struct in_addr a;
   int i;
-  char* addr;
-  int mx_found = 0;
-  int ip_found = 0;
   uint16_t mx_preference;
   char* mx;
   
@@ -114,20 +110,8 @@
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_A)
+      if (rd[i].record_type == GNUNET_GNS_RECORD_MX)
       {
-        memcpy(&a, rd[i].data, sizeof(a));
-        addr = inet_ntoa(a);
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO, "address: %s\n", addr);
-        if (0 == strcmp(addr, TEST_IP))
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "%s correctly resolved to %s!\n", TEST_DOMAIN, addr);
-          ip_found = 1;
-        }
-      }
-      else if (rd[i].record_type == GNUNET_GNS_RECORD_MX)
-      {
         mx = (char*)rd[i].data+sizeof(uint16_t);
         mx_preference = *(uint16_t*)rd[i].data;
         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -137,26 +121,12 @@
           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                       "%s correctly resolved to %s!\n", TEST_DOMAIN,
                       TEST_EXPECTED_MX);
-          mx_found = 1;
+          ok = 0;
         }
       }
     }
   }
 
-  if (ip_found && mx_found)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Test succeeded!\n");
-    ok = 0;
-  }
-
-  if (!ip_found && mx_found)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-  "A record not passed along!(NOT IMPLEMENTED)\n");
-    ok = 0;
-  }
-
   GNUNET_GNS_disconnect(gns_handle);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
   GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);

Modified: gnunet/src/gns/test_gns_simple_srv_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_srv_lookup.c 2012-06-24 22:01:52 UTC (rev 
22259)
+++ gnunet/src/gns/test_gns_simple_srv_lookup.c 2012-06-24 23:32:15 UTC (rev 
22260)
@@ -30,6 +30,7 @@
 #include "gnunet_namestore_service.h"
 #include "../namestore/namestore.h"
 #include "gnunet_dnsparser_lib.h"
+#include "../dns/dnsparser.h"
 #include "gnunet_gns_service.h"
 
 /* DEFINES */
@@ -185,14 +186,6 @@
   ok = 1;
 }
 
-GNUNET_NETWORK_STRUCT_BEGIN
-struct srv_data
-{
-  uint16_t prio GNUNET_PACKED;
-  uint16_t weight GNUNET_PACKED;
-  uint16_t port GNUNET_PACKED;
-};
-GNUNET_NETWORK_STRUCT_END
 
 static void
 do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,




reply via email to

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