about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--argp/tst-ldbl-argp.c9
-rw-r--r--misc/tst-ldbl-error.c9
-rw-r--r--misc/tst-ldbl-warn.c6
4 files changed, 10 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index f5a8656571..c75111bb08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-11-08  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	* 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.
+
 2018-11-08  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/kernel-features.h: Remove comment about
diff --git a/argp/tst-ldbl-argp.c b/argp/tst-ldbl-argp.c
index 4465f812af..231abeb18c 100644
--- a/argp/tst-ldbl-argp.c
+++ b/argp/tst-ldbl-argp.c
@@ -73,14 +73,7 @@ do_one_test (const char *expected)
   struct support_capture_subprocess result;
   result = support_capture_subprocess ((void *) &do_test_call, NULL);
 
-  if (strcmp (result.err.buffer, expected) != 0)
-    {
-      support_record_failure ();
-      printf ("error:\n"
-	      "    expected: '%s'\n"
-	      "      actual: '%s'\n",
-	      expected, result.err.buffer);
-    }
+  TEST_COMPARE_STRING (result.err.buffer, expected);
 
   return 0;
 }
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);
 }
diff --git a/misc/tst-ldbl-warn.c b/misc/tst-ldbl-warn.c
index 3ac0e4c873..69a528755c 100644
--- a/misc/tst-ldbl-warn.c
+++ b/misc/tst-ldbl-warn.c
@@ -61,11 +61,7 @@ do_one_test (int select, const char *format, va_list args,
 
   /* Close the in-memory stream and check the output buffer.  */
   xfclose_memstream (&stream);
-  if (strcmp (stream.buffer, expected) != 0)
-    FAIL_EXIT1 ("error:\n"
-		"    expected: '%s'\n"
-		"      actual: '%s'\n",
-		expected, stream.buffer);
+  TEST_COMPARE_STRING (stream.buffer, expected);
 
   if (stream.buffer != NULL)
     free (stream.buffer);