]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
resolv: Improve debugging output from tst-resolv-res_init
authorFlorian Weimer <fweimer@redhat.com>
Fri, 30 Jun 2017 16:02:11 +0000 (18:02 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 30 Jun 2017 16:02:11 +0000 (18:02 +0200)
ChangeLog
resolv/tst-resolv-res_init-skeleton.c

index ec7ce1c0447cb5a3e01c1bf88676e2ce7f959cbd..a0a744e6f95c133c45c157c9ef5c5a659d7e0606 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-30  Florian Weimer  <fweimer@redhat.com>
+
+       * resolv/tst-resolv-res_init-skeleton.c (test_init_names): New
+       variable.
+       (test_file_contents): Use it.
+
 2017-06-30  Florian Weimer  <fweimer@redhat.com>
 
        * resolv/res_init.c (res_setoptions): Remove source argument.
index 2b68c5ff9a69a291f30c1f9a79ca6b56012ba7db..b5fe2cfb002679f2f7980abe2b83836e708ca7a2 100644 (file)
@@ -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);
           }