From patchwork Fri Jun 30 16:04:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 21369 Received: (qmail 60106 invoked by alias); 30 Jun 2017 16:04:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 59523 invoked by uid 89); 30 Jun 2017 16:04:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1541 X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 01EDD44BD5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 01EDD44BD5 Date: Fri, 30 Jun 2017 18:04:44 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] resolv: Improve debugging output from tst-resolv-res_init User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170630160444.C7717439942F0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-06-30 Florian Weimer * resolv/tst-resolv-res_init-skeleton.c (test_init_names): New variable. (test_file_contents): Use it. diff --git a/resolv/tst-resolv-res_init-skeleton.c b/resolv/tst-resolv-res_init-skeleton.c index 2b68c5f..b5fe2cf 100644 --- a/resolv/tst-resolv-res_init-skeleton.c +++ b/resolv/tst-resolv-res_init-skeleton.c @@ -257,6 +257,15 @@ enum test_init test_init_method_last = test_getaddrinfo }; +static const char *const test_init_names[] = + { + [test_init] = "res_init", + [test_ninit] = "res_init", + [test_mkquery] = "res_mkquery", + [test_gethostbyname] = "gethostbyname", + [test_getaddrinfo] = "getaddrinfo", + }; + /* Closure argument for run_res_init. */ struct test_context { @@ -507,7 +516,8 @@ test_file_contents (const struct test_case *t) ++init_method) { if (test_verbose > 0) - printf ("info: testing init method %d\n", init_method); + printf ("info: testing init method %s\n", + test_init_names[init_method]); struct test_context ctx = { .init = init_method, .t = t }; void (*func) (void *) = run_res_init; #if TEST_THREAD @@ -519,7 +529,8 @@ test_file_contents (const struct test_case *t) if (strcmp (proc.out.buffer, t->expected) != 0) { support_record_failure (); - printf ("error: output mismatch for %s\n", t->name); + printf ("error: output mismatch for %s (init method %s)\n", + t->name, test_init_names[init_method]); support_run_diff ("expected", t->expected, "actual", proc.out.buffer); }