]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Make this test less sensitive to newline variations; this
authorTim Kientzle <kientzle@gmail.com>
Sun, 27 Dec 2009 23:18:08 +0000 (18:18 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 27 Dec 2009 23:18:08 +0000 (18:18 -0500)
should fix a test failure seen on Cygwin.

SVN-Revision: 1777

tar/test/test_stdio.c

index 028e7fff6537c49d635ac758daa3f51258da035a..b95a4e30542c6718f264f0f2ec6205e9d2fbb66e 100644 (file)
@@ -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. */