From 1165fadbf2811f82040ba653bffe6e4fe4c9e186 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 27 Dec 2009 18:18:08 -0500 Subject: [PATCH] Make this test less sensitive to newline variations; this should fix a test failure seen on Cygwin. SVN-Revision: 1777 --- tar/test/test_stdio.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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. */ -- 2.47.3