about summary refs log tree commit diff
path: root/misc/tst-ldbl-error.c
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>2018-11-06 17:44:13 -0200
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>2018-11-08 22:42:01 -0200
commit43257c335ad6b9e05fb882975e1776ff763164ee (patch)
tree0d73bd4922bd0536f72178310c14505449910fb9 /misc/tst-ldbl-error.c
parente5de3b5b72afffdebb7f4642015060a5c437d546 (diff)
downloadglibc-43257c335ad6b9e05fb882975e1776ff763164ee.tar.gz
glibc-43257c335ad6b9e05fb882975e1776ff763164ee.tar.xz
glibc-43257c335ad6b9e05fb882975e1776ff763164ee.zip
Use TEST_COMPARE_STRING in recently added test
The commit

commit 1df872fd74f730bcae3df201a229195445d2e18a
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Nov 7 12:42:44 2018 +0100

    support: Implement TEST_COMPARE_STRING

added the new macro TEST_COMPARE_STRING, which compares the output of
functions under test against expected strings, and, when there's a
mismatch, automatically reports an error and prints the differences.
This patch adapts recently added test cases to use this new macro.

Tested for powerpc64le (as is, and locally patched to intentionally fail
and produce error output).

	* argp/tst-ldbl-argp.c (do_one_test): Use TEST_COMPARE_STRING,
	instead of manually comparing and reporting mismatching strings.
	* misc/tst-ldbl-error.c (do_one_test): Likewise.
	* misc/tst-ldbl-warn.c (do_one_test): Likewise.
Diffstat (limited to 'misc/tst-ldbl-error.c')
-rw-r--r--misc/tst-ldbl-error.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/misc/tst-ldbl-error.c b/misc/tst-ldbl-error.c
index a02cb2772a..76b2c8f784 100644
--- a/misc/tst-ldbl-error.c
+++ b/misc/tst-ldbl-error.c
@@ -95,14 +95,7 @@ do_one_test (void *callback, const char *expected, ...)
   message = strstr (result.err.buffer, needle);
 
   /* Verify that the output message is as expected.  */
-  if (strcmp (message, expected) != 0)
-    {
-      support_record_failure ();
-      printf ("error:\n"
-	      "    expected: '%s'\n"
-	      "      actual: '%s'\n",
-	      expected, message);
-    }
+  TEST_COMPARE_STRING (message, expected);
 
   va_end (args);
 }