From: Michihiro NAKAJIMA Date: Mon, 16 Feb 2009 06:56:51 +0000 (-0500) Subject: Consider carriage return code on Windows. X-Git-Tag: v2.7.0~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ab399d0c50e07cfdc51e59a30d08022006e8e8d;p=thirdparty%2Flibarchive.git Consider carriage return code on Windows. SVN-Revision: 641 --- diff --git a/tar/test/test_patterns.c b/tar/test/test_patterns.c index 227b4a53d..8d17bd63e 100644 --- a/tar/test/test_patterns.c +++ b/tar/test/test_patterns.c @@ -59,7 +59,11 @@ DEFINE_TEST(test_patterns) r = systemf("%s tf %s /tmp/foo/bar > tar2a.out 2> tar2a.err", testprog, reffile2); assertEqualInt(r, 0); +#ifndef _WIN32 p = "/tmp/foo/bar/\n/tmp/foo/bar/baz\n"; +#else + p = "/tmp/foo/bar/\r\n/tmp/foo/bar/baz\r\n"; +#endif assertFileContents(p, strlen(p), "tar2a.out"); assertEmptyFile("tar2a.err"); diff --git a/tar/test/test_version.c b/tar/test/test_version.c index 6ed656d80..a3b7151e1 100644 --- a/tar/test/test_version.c +++ b/tar/test/test_version.c @@ -88,6 +88,10 @@ DEFINE_TEST(test_version) ++q; /* All terminated by a newline. */ assert(s >= 1); +#ifndef _WIN32 assertEqualMem(q, "\n", 1); +#else + assertEqualMem(q, "\r\n", 2); +#endif free(p); }