]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Verify that the correct data gets written to stdout with xvO.
authorTim Kientzle <kientzle@gmail.com>
Fri, 17 Jul 2009 04:24:49 +0000 (00:24 -0400)
committerTim Kientzle <kientzle@gmail.com>
Fri, 17 Jul 2009 04:24:49 +0000 (00:24 -0400)
SVN-Revision: 1231

tar/test/test_stdio.c

index f60d3b3723d8849a1a7627ecf532d1409260d41a..93209ea8796a3cd6ec802632d7b2e44aaeef1a95 100644 (file)
@@ -29,6 +29,8 @@ DEFINE_TEST(test_stdio)
 {
        FILE *f;
        FILE *filelist;
+       char *p;
+       size_t s;
        int oldumask;
        int r;
 
@@ -112,7 +114,11 @@ DEFINE_TEST(test_stdio)
        /* 'xvOf' should generate list on stderr, file contents on stdout. */
        r = systemf("%s xvOf archive >xvOf.out 2>xvOf.err", testprog);
        assertEqualInt(r, 0);
-       /* TODO: Verify xvOf.out */
+       /* Verify xvOf.out is the file contents */
+       p = slurpfile(&s, "xvOf.out");
+       assert(p != NULL);
+       assert(s = 2);
+       assertEqualMem(p, "f\n", 2);
        /* TODO: Verify xvf.err */
 
        /* 'xvf -' should generate list on stderr, empty stdout. */