From 43257c335ad6b9e05fb882975e1776ff763164ee Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Tue, 6 Nov 2018 17:44:13 -0200 Subject: Use TEST_COMPARE_STRING in recently added test The commit commit 1df872fd74f730bcae3df201a229195445d2e18a Author: Florian Weimer 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. --- argp/tst-ldbl-argp.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'argp/tst-ldbl-argp.c') diff --git a/argp/tst-ldbl-argp.c b/argp/tst-ldbl-argp.c index 4465f81..231abeb 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; } -- cgit v1.1