Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Apr 2, 2014
1 parent e993102 commit f3cace2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/dns_regress.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,23 @@ static void
rdns_regress_callback (struct rdns_reply *reply, void *arg)
{
struct rdns_reply_entry *entry;
char out[INET6_ADDRSTRLEN + 1];

printf ("got result for host: %s, code: %s\n", (const char *)arg,
rdns_strerror (reply->code));

if (reply->code == DNS_RC_NOERROR) {
if (reply->code == RDNS_RC_NOERROR) {
entry = reply->entries;
while (entry != NULL) {
if (entry->type == DNS_REQUEST_A) {
printf ("%s is %s\n", (char *)arg, inet_ntoa (entry->content.a.addr));
if (entry->type == RDNS_REQUEST_A) {
inet_ntop (AF_INET, &entry->content.a.addr, out, sizeof (out));
printf ("%s has A record %s\n", (char *)arg, out);
}
else if (entry->type == DNS_REQUEST_TLSA) {
else if (entry->type == RDNS_REQUEST_AAAA) {
inet_ntop (AF_INET6, &entry->content.aaa.addr, out, sizeof (out));
printf ("%s has AAAA record %s\n", (char *)arg, out);
}
else if (entry->type == RDNS_REQUEST_TLSA) {
char *hex, *p;
unsigned i;

Expand Down Expand Up @@ -89,7 +95,8 @@ rdns_test_a (struct rdns_resolver *resolver)
const char **cur;

for (cur = names; *cur != NULL; cur ++) {
rdns_make_request_full (resolver, rdns_regress_callback, *cur, 1.0, 2, *cur, 1, DNS_REQUEST_A);
rdns_make_request_full (resolver, rdns_regress_callback, *cur, 1.0, 2, 2,
*cur, RDNS_REQUEST_AAAA, *cur, RDNS_REQUEST_A);
remain_tests ++;
}
}
Expand All @@ -105,7 +112,7 @@ rdns_test_tlsa (struct rdns_resolver *resolver)
const char **cur;

for (cur = names; *cur != NULL; cur ++) {
rdns_make_request_full (resolver, rdns_regress_callback, *cur, 1.0, 2, *cur, 1, DNS_REQUEST_TLSA);
rdns_make_request_full (resolver, rdns_regress_callback, *cur, 1.0, 2, 1, *cur, RDNS_REQUEST_TLSA);
remain_tests ++;
}
}
Expand Down

0 comments on commit f3cace2

Please sign in to comment.