From da69908da5c89e01c663b54da76099033aca4bb0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 27 Sep 2012 10:09:36 +0000 Subject: -fixing testcase shutdown --- src/gns/gns_api.c | 2 +- src/gns/test_gns_max_queries.c | 106 +++++++++++++++++++++++++---------------- 2 files changed, 66 insertions(+), 42 deletions(-) diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 8d0fe6e99..94142ea88 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c @@ -899,7 +899,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, * @param proc_cls closure for processor * @return handle to the lookup request */ -struct GNUNET_GNS_LookupRequest* +struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, const char *name, enum GNUNET_GNS_RecordType type, diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index fecc40925..d06f4ebed 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c @@ -32,8 +32,6 @@ #include "gnunet_dnsparser_lib.h" #include "gnunet_gns_service.h" -/* DEFINES */ -#define VERBOSE GNUNET_YES /* Timeout for entire testcase */ #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 20) @@ -54,7 +52,7 @@ /* Globals */ /* Task handle to use to schedule test failure */ -GNUNET_SCHEDULER_TaskIdentifier die_task; +static GNUNET_SCHEDULER_TaskIdentifier die_task; /* Global return value (0 for success, anything else for failure) */ static int ok; @@ -63,10 +61,14 @@ static struct GNUNET_NAMESTORE_Handle *namestore_handle; static struct GNUNET_GNS_Handle *gns_handle; -const struct GNUNET_CONFIGURATION_Handle *cfg; +static const struct GNUNET_CONFIGURATION_Handle *cfg; static unsigned long long max_parallel_lookups; +static struct GNUNET_GNS_LookupRequest **requests; + +static unsigned int num_requests; + /** * Check if the get_handle is being used, if so stop the request. Either @@ -76,13 +78,17 @@ static unsigned long long max_parallel_lookups; static void end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { + unsigned int i; + + for (i=0;i