From: Tim Kientzle Date: Fri, 17 Jul 2009 04:24:49 +0000 (-0400) Subject: Verify that the correct data gets written to stdout with xvO. X-Git-Tag: v2.8.0~530 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfeb43d8c9df8ea84370b84e088fb5261cace6ca;p=thirdparty%2Flibarchive.git Verify that the correct data gets written to stdout with xvO. SVN-Revision: 1231 --- diff --git a/tar/test/test_stdio.c b/tar/test/test_stdio.c index f60d3b372..93209ea87 100644 --- a/tar/test/test_stdio.c +++ b/tar/test/test_stdio.c @@ -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. */