From 287d9eaf1a821d763b51cac14e526ddc7ebdbe12 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 22 Mar 2012 18:20:49 +0000 Subject: [PATCH] -add correct file --- ..._queries_test.c => test_gns_max_queries.c} | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) rename src/gns/{test_gns_max_queries_test.c => test_gns_max_queries.c} (84%) diff --git a/src/gns/test_gns_max_queries_test.c b/src/gns/test_gns_max_queries.c similarity index 84% rename from src/gns/test_gns_max_queries_test.c rename to src/gns/test_gns_max_queries.c index a244b3f02..304ec68be 100644 --- a/src/gns/test_gns_max_queries_test.c +++ b/src/gns/test_gns_max_queries.c @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ /** - * @file gns/test_gns_max_queries_test.c + * @file gns/test_gns_max_queries.c * @brief base testcase for testing GNS background queries * in particular query replacement and clean shutdown */ @@ -26,6 +26,7 @@ #include "gnunet_testing_lib.h" #include "gnunet_core_service.h" #include "block_dns.h" +#include "gns.h" #include "gnunet_signatures.h" #include "gnunet_namestore_service.h" #include "gnunet_dnsparser_lib.h" @@ -42,10 +43,11 @@ /* test records to resolve */ #define TEST_DOMAIN "www.gnunet" -#define TEST_DOMAIN_NACK "doesnotexist.gnunet" +#define TEST_DOMAIN_NACK "doesnotexist.bob.gnunet" #define TEST_IP "127.0.0.1" #define TEST_RECORD_NAME "www" -#define TEST_ADDITIONAL_LOOKUPS 10 +#define TEST_ADDITIONAL_LOOKUPS 5 +#define TEST_AUTHORITY_NAME "bob" /* Globals */ @@ -87,6 +89,18 @@ shutdown_callback (void *cls, const char *emsg) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "done(ret=%d)!\n", ok); } +static void +on_lookup_result_dummy(void *cls, uint32_t rd_count, + const struct GNUNET_NAMESTORE_RecordData *rd) +{ + if (rd_count != 0) + { + GNUNET_log(GNUNET_ERROR_TYPE_ERROR, + "Got %d results from dummy lookup! Wanted: 0\n", + rd_count); + ok = -1; + } +} static void on_lookup_result(void *cls, uint32_t rd_count, @@ -142,6 +156,7 @@ static void commence_testing (void *cls, int32_t success, const char *emsg) { int i; + char lookup_name[MAX_DNS_NAME_LENGTH]; GNUNET_NAMESTORE_disconnect(namestore_handle, GNUNET_YES); @@ -160,7 +175,10 @@ commence_testing (void *cls, int32_t success, const char *emsg) /* Now lookup some non existing records */ for (i=0; i