From: Tim Kientzle Date: Thu, 28 Apr 2016 06:05:19 +0000 (-0700) Subject: Issue 685: Just verify the body of the error message; ignore the program name X-Git-Tag: v3.2.0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aede611b9ea9e481586ed606c5af24b7e468ba7;p=thirdparty%2Flibarchive.git Issue 685: Just verify the body of the error message; ignore the program name --- diff --git a/tar/test/test_leading_slash.c b/tar/test/test_leading_slash.c index 52646d00c..a390e11fe 100644 --- a/tar/test/test_leading_slash.c +++ b/tar/test/test_leading_slash.c @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_leading_slash) { const char *reffile = "test_leading_slash.tar"; + char *errfile; + size_t errfile_size; + const char *expected_errmsg = "Removing leading '/' from member names"; extract_reference_file(reffile); assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", testprog, reffile)); @@ -36,10 +39,11 @@ DEFINE_TEST(test_leading_slash) assertTextFileContents("foo\x0a", "foo/hardlink"); assertIsHardlink("foo/file", "foo/hardlink"); assertEmptyFile("test.out"); -#ifdef _WIN32 - assertTextFileContents("bsdtar.exe: Removing leading '/' from member names\x0a", "test.err"); -#else - assertTextFileContents("bsdtar: Removing leading '/' from member names\x0a", "test.err"); -#endif + + /* Verify the error output contains the expected text somewhere in it */ + if (assertFileExists("test.err")) { + errfile = slurpfile(&errfile_size, "test.err"); + assert(strstr(errfile, expected_errmsg)); + } }