From: Paul Eggert Date: Mon, 20 May 2024 16:54:26 +0000 (-0700) Subject: linkat-tests: fix up assertion-failure changes X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=372cd77750a41bffd1c0d6cddf5c88067128f641;p=gnulib.git linkat-tests: fix up assertion-failure changes * tests/test-linkat.c (main): Don’t lose the failure results of earlier tests. Problem found by Coverity. --- diff --git a/ChangeLog b/ChangeLog index 997f51f3b5..ea799492a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2024-05-20 Paul Eggert + linkat-tests: fix up assertion-failure changes + * tests/test-linkat.c (main): Don’t lose the failure results of + earlier tests. Problem found by Coverity. + dfa: attempt to pacify Coverity * lib/dfa.c (lex): Use ‘assume’ rather than ‘abort’, to try to pacify Coverity. diff --git a/tests/test-linkat.c b/tests/test-linkat.c index c3efb5df60..04814ddd1b 100644 --- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -141,7 +141,7 @@ main (void) /* Skip the rest of the test if the file system does not support hard links and symlinks. */ if (result) - return result; + return test_exit_status ? test_exit_status : result; /* Create locations to manipulate. */ ASSERT (mkdir (BASE "sub1", 0700) == 0); @@ -202,10 +202,13 @@ main (void) ASSERT (rmdir (BASE "sub1") == 0); ASSERT (rmdir (BASE "sub2") == 0); free (cwd); - if (!result) - fputs ("skipping test: symlinks not supported on this file system\n", - stderr); - return result; + if (!test_exit_status) + { + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); + return 77; + } + return test_exit_status; } dfd = open (".", O_RDONLY); ASSERT (0 <= dfd); @@ -384,5 +387,5 @@ main (void) ASSERT (unlink (BASE "link5") == 0); free (cwd); - return (result ? result : test_exit_status); + return test_exit_status; }