Add unit test and catch a typo

This commit is contained in:
Sara Dickinson 2017-03-16 16:26:34 +00:00
parent f0f3c43552
commit 2a1a6768cb
2 changed files with 25 additions and 1 deletions

View File

@ -61,7 +61,7 @@ getdns_context_set_suffix
getdns_context_set_timeout
getdns_context_set_tls_authentication
getdns_context_set_tls_query_padding_blocksize
getdns_context_get_tls_use_all_upstreams
getdns_context_set_tls_use_all_upstreams
getdns_context_set_update_callback
getdns_context_set_upstream_recursive_servers
getdns_context_set_use_threads

View File

@ -434,6 +434,29 @@
}
END_TEST
START_TEST (getdns_context_set_context_update_callback_23)
{
/*
* value is NULL
* expect: GETDNS_RETURN_INVALID_PARAMETER
*/
struct getdns_context *context = NULL;
CONTEXT_CREATE(TRUE);
ASSERT_RC(getdns_context_set_context_update_callback(context, update_callbackfn),
GETDNS_RETURN_GOOD, "Return code from getdns_context_set_context_update_callback()");
expected_changed_item = GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS;
ASSERT_RC(getdns_context_set_tls_use_all_upstreams(context, 1),
GETDNS_RETURN_GOOD, "Return code from getdns_context_set_timeout()");
CONTEXT_DESTROY;
}
END_TEST
Suite *
getdns_context_set_context_update_callback_suite (void)
@ -462,6 +485,7 @@
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_20);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_21);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_22);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_23);
suite_add_tcase(s, tc_pos);
return s;