From: Tim Kientzle Date: Sun, 27 Dec 2009 23:18:08 +0000 (-0500) Subject: Make this test less sensitive to newline variations; this X-Git-Tag: v2.8.0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1165fadbf2811f82040ba653bffe6e4fe4c9e186;p=thirdparty%2Flibarchive.git Make this test less sensitive to newline variations; this should fix a test failure seen on Cygwin. SVN-Revision: 1777 --- diff --git a/tar/test/test_stdio.c b/tar/test/test_stdio.c index 028e7fff6..b95a4e305 100644 --- a/tar/test/test_stdio.c +++ b/tar/test/test_stdio.c @@ -27,7 +27,6 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_stdio.c,v 1.2 2008/05/26 17:10:10 DEFINE_TEST(test_stdio) { - FILE *f; FILE *filelist; char *p; size_t s; @@ -38,16 +37,15 @@ DEFINE_TEST(test_stdio) /* * Create a couple of files on disk. */ - filelist = fopen("filelist", "w"); - assert(filelist != NULL); /* File */ - f = fopen("f", "w"); - assert(f != NULL); - fprintf(f, "f\n"); - fclose(f); - fprintf(filelist, "f\n"); + assertMakeFile("f", 0755, "abc"); /* Link to above file. */ assertMakeHardlink("l", "f"); + + /* Create file list (text mode here) */ + filelist = fopen("filelist", "w"); + assert(filelist != NULL); + fprintf(filelist, "f\n"); fprintf(filelist, "l\n"); fclose(filelist); @@ -115,9 +113,8 @@ DEFINE_TEST(test_stdio) assertEqualInt(r, 0); /* Verify xvOf.out is the file contents */ p = slurpfile(&s, "xvOf.out"); - assert(p != NULL); - assert(s = 2); - assertEqualMem(p, "f\n", 2); + assert(s = 3); + assertEqualMem(p, "abc", 3); /* TODO: Verify xvf.err */ /* 'xvf -' should generate list on stderr, empty stdout. */