8597553
commit a9270e673dcc1ef1d2c2d96fa09d468c59883d88
8597553
Author: Florian Weimer <fweimer@redhat.com>
8597553
Date:   Fri Jun 30 18:02:11 2017 +0200
8597553
8597553
    resolv: Improve debugging output from tst-resolv-res_init
8597553
8597553
diff --git a/resolv/tst-resolv-res_init-skeleton.c b/resolv/tst-resolv-res_init-skeleton.c
8597553
index 2b68c5ff9a69a291..b5fe2cfb002679f2 100644
8597553
--- a/resolv/tst-resolv-res_init-skeleton.c
8597553
+++ b/resolv/tst-resolv-res_init-skeleton.c
8597553
@@ -257,6 +257,15 @@ enum test_init
8597553
   test_init_method_last = test_getaddrinfo
8597553
 };
8597553
 
8597553
+static const char *const test_init_names[] =
8597553
+  {
8597553
+    [test_init] = "res_init",
8597553
+    [test_ninit] = "res_init",
8597553
+    [test_mkquery] = "res_mkquery",
8597553
+    [test_gethostbyname] = "gethostbyname",
8597553
+    [test_getaddrinfo] = "getaddrinfo",
8597553
+  };
8597553
+
8597553
 /* Closure argument for run_res_init.  */
8597553
 struct test_context
8597553
 {
8597553
@@ -507,7 +516,8 @@ test_file_contents (const struct test_case *t)
8597553
          ++init_method)
8597553
       {
8597553
         if (test_verbose > 0)
8597553
-          printf ("info:  testing init method %d\n", init_method);
8597553
+          printf ("info:  testing init method %s\n",
8597553
+                  test_init_names[init_method]);
8597553
         struct test_context ctx = { .init = init_method, .t = t };
8597553
         void (*func) (void *) = run_res_init;
8597553
 #if TEST_THREAD
8597553
@@ -519,7 +529,8 @@ test_file_contents (const struct test_case *t)
8597553
         if (strcmp (proc.out.buffer, t->expected) != 0)
8597553
           {
8597553
             support_record_failure ();
8597553
-            printf ("error: output mismatch for %s\n", t->name);
8597553
+            printf ("error: output mismatch for %s (init method %s)\n",
8597553
+                    t->name, test_init_names[init_method]);
8597553
             support_run_diff ("expected", t->expected,
8597553
                               "actual", proc.out.buffer);
8597553
           }