From f9a0974e5a8b7e0c4607ed4873e9571d24d82a10 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 29 Jan 2015 12:29:05 +0100 Subject: [PATCH] just_address_answers only with getdns_address() We gave it always, but reading the spec it seems it is only required when a call to getdns_address() or getdns_address_sync() was made. --- src/test/check_getdns_common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/check_getdns_common.c b/src/test/check_getdns_common.c index 58934357..43fce6f0 100644 --- a/src/test/check_getdns_common.c +++ b/src/test/check_getdns_common.c @@ -69,9 +69,9 @@ void extract_response(struct getdns_dict *response, struct extracted_response *e ASSERT_RC(getdns_dict_get_bindata(response, "canonical_name", &ex_response->top_canonical_name), GETDNS_RETURN_GOOD, "Failed to extract \"top canonical_name\""); - ASSERT_RC(getdns_dict_get_list(response, "just_address_answers", &ex_response->just_address_answers), - GETDNS_RETURN_GOOD, "Failed to extract \"just_address_answers\""); - ck_assert_msg(ex_response->just_address_answers != NULL, "just_address_answers should not be NULL"); + /* just_address_answers have to appear only on getdns_address calls */ + ex_response->just_address_answers = NULL; + (void)getdns_dict_get_list(response, "just_address_answers", &ex_response->just_address_answers); ASSERT_RC(getdns_dict_get_list(response, "replies_full", &ex_response->replies_full), GETDNS_RETURN_GOOD, "Failed to extract \"replies_full\""); @@ -138,9 +138,9 @@ void extract_local_response(struct getdns_dict *response, struct extracted_respo ASSERT_RC(getdns_dict_get_bindata(response, "canonical_name", &ex_response->top_canonical_name), GETDNS_RETURN_GOOD, "Failed to extract \"top canonical_name\""); - ASSERT_RC(getdns_dict_get_list(response, "just_address_answers", &ex_response->just_address_answers), - GETDNS_RETURN_GOOD, "Failed to extract \"just_address_answers\""); - ck_assert_msg(ex_response->just_address_answers != NULL, "just_address_answers should not be NULL"); + /* just_address_answers have to appear only on getdns_address calls */ + ex_response->just_address_answers = NULL; + (void)getdns_dict_get_list(response, "just_address_answers", &ex_response->just_address_answers); ASSERT_RC(getdns_dict_get_int(response, "status", &ex_response->status), GETDNS_RETURN_GOOD, "Failed to extract \"status\"");