Merge pull request #82 from verisign/feature/test_ipaddress

add new test set_timeout and removed printf
This commit is contained in:
Nitin 2014-01-31 07:00:36 -08:00
commit f38a9f4828
2 changed files with 26 additions and 4 deletions

View File

@ -286,7 +286,4 @@ void update_callbackfn(struct getdns_context *context,
ck_assert_msg(changed_item == expected_changed_item,
"Expected changed_item == %d, got %d",
changed_item, expected_changed_item);
printf("changed_item:%d\n",changed_item);
printf("expected_changed_item:%d\n",expected_changed_item);
}

View File

@ -34,7 +34,7 @@
struct getdns_context *context = NULL;
ASSERT_RC(getdns_context_set_context_update_callback(context, NULL),
GETDNS_RETURN_BAD_CONTEXT, "Return code from getdns_context_set_context_update_callback()");
GETDNS_RETURN_INVALID_PARAMETER, "Return code from getdns_context_set_context_update_callback()");
}
END_TEST
@ -136,6 +136,30 @@
}
END_TEST
START_TEST (getdns_context_set_context_update_callback_9)
{
/*
* Create a context by calling getdns_context_create()
* Define a callback routine for context changes and call getdns_context_set_context_update_callback() so that it gets called when there are context changes
* Call getdns_context_set_timeout() and set timeout to 3 seconds
* expect: GETDNS_CONTEXT_CODE_TIMEOUT
*/
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_TIMEOUT;
ASSERT_RC(getdns_context_set_timeout(context, 3),
GETDNS_RETURN_GOOD, "Return code from getdns_context_set_timeout()");
CONTEXT_DESTROY;
}
END_TEST
START_TEST (getdns_context_set_context_update_callback_10)
{
/*
@ -322,6 +346,7 @@
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_6);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_7);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_8);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_9);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_10);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_15);
tcase_add_test(tc_pos, getdns_context_set_context_update_callback_16);