mirror of https://github.com/getdnsapi/getdns.git
Changelog, idle_timeout test, formatting
This commit is contained in:
parent
68dfb15706
commit
0acdcc34b0
|
@ -3,6 +3,7 @@
|
|||
* Added new transport list options in API. The option is now an ordered list of
|
||||
GETDNS_TRANSPORT_UDP, GETDNS_TRANSPORT_TCP, GETDNS_TRANSPORT_TLS,
|
||||
GETDNS_TRANSPORT_STARTTLS.
|
||||
* Added new context setting for idle_timeout
|
||||
|
||||
* 2015-05-21: Version 0.2.0
|
||||
* Fix libversion numbering: Thanks Daniel Kahn Gillmor
|
||||
|
|
|
@ -77,6 +77,39 @@ START_TEST (getdns_context_set_timeout_2)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (getdns_context_set_idle_timeout_1)
|
||||
{
|
||||
/*
|
||||
* context is NULL
|
||||
* expect: GETDNS_RETURN_INVALID_PARAMETER
|
||||
*/
|
||||
|
||||
struct getdns_context *context = NULL;
|
||||
|
||||
ASSERT_RC(getdns_context_set_idle_timeout(context, 1000),
|
||||
GETDNS_RETURN_INVALID_PARAMETER, "Return code from getdns_context_set_timeout()");
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (getdns_context_set_idle_timeout_2)
|
||||
{
|
||||
/*
|
||||
* timeout is 0
|
||||
* expect: GETDNS_RETURN_INVALID_PARAMETER
|
||||
*/
|
||||
|
||||
struct getdns_context *context = NULL;
|
||||
CONTEXT_CREATE(TRUE);
|
||||
|
||||
ASSERT_RC(getdns_context_set_idle_timeout(context, 0),
|
||||
GETDNS_RETURN_INVALID_PARAMETER, "Return code from getdns_context_set_timeout()");
|
||||
|
||||
CONTEXT_DESTROY;
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
#define GETDNS_STR_IPV4 "IPv4"
|
||||
#define GETDNS_STR_IPV6 "IPv6"
|
||||
#define GETDNS_STR_ADDRESS_TYPE "address_type"
|
||||
|
@ -270,6 +303,8 @@ getdns_context_set_timeout_suite (void)
|
|||
TCase *tc_neg = tcase_create("Negative");
|
||||
tcase_add_test(tc_neg, getdns_context_set_timeout_1);
|
||||
tcase_add_test(tc_neg, getdns_context_set_timeout_2);
|
||||
tcase_add_test(tc_neg, getdns_context_set_idle_timeout_1);
|
||||
tcase_add_test(tc_neg, getdns_context_set_idle_timeout_2);
|
||||
suite_add_tcase(s, tc_neg);
|
||||
|
||||
/* Positive test cases */
|
||||
|
|
Loading…
Reference in New Issue