diff --git a/src/test/getdns_query.c b/src/test/getdns_query.c index 44bbd5b9..eeb3ca04 100644 --- a/src/test/getdns_query.c +++ b/src/test/getdns_query.c @@ -1167,6 +1167,45 @@ static getdns_return_t _get_list_or_read_file(const getdns_dict *config, return r; } +#define CONTEXT_SETTING_INT(X) \ + } else if (_streq(setting, #X)) { \ + if ((r = getdns_dict_get_int(config, #X , &n))) \ + fprintf(stderr, "Could not get \"" #X "\""); \ + else if ((r = getdns_context_set_ ## X (context, n))) \ + fprintf(stderr,"Error configuring \"" #X "\""); + +#define CONTEXT_SETTING_LIST(X) \ + } else if (_streq(setting, #X)) { \ + if ((r = getdns_dict_get_list(config, #X , &list))) \ + fprintf(stderr, "Could not get \"" #X "\""); \ + else if ((r = getdns_context_set_ ## X (context, list))) \ + fprintf(stderr,"Error configuring \"" #X "\""); + +#define CONTEXT_SETTING_LIST_OR_ZONEFILE(X) \ + } else if (_streq(setting, #X)) { \ + if ((r = _get_list_or_read_file( \ + config, #X , &list, &destroy_list))) \ + fprintf(stderr, "Could not get \"" #X "\""); \ + else if ((r = getdns_context_set_ ## X(context, list))) \ + fprintf(stderr, "Error configuring \"" #X "\""); \ + if (destroy_list) getdns_list_destroy(list); + +#define CONTEXT_SETTING_ARRAY(X, T) \ + } else if (_streq(setting, #X )) { \ + if ((r = getdns_dict_get_list(config, #X , &list))) \ + fprintf(stderr, "Could not get \"" #X "\""); \ + else if ((r = getdns_list_get_length(list, &count))) \ + fprintf(stderr, "Could not length of \"" #X "\""); \ + else for (i=0; iquery,"/question/qname",&qname)))