]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Update test_copy style.
authorTim Kientzle <kientzle@gmail.com>
Mon, 31 Aug 2009 04:07:44 +0000 (00:07 -0400)
committerTim Kientzle <kientzle@gmail.com>
Mon, 31 Aug 2009 04:07:44 +0000 (00:07 -0400)
Fix bug where directory on command line got mis-reported.

SVN-Revision: 1407

tar/test/test_copy.c
tar/tree.c

index c48cdfea620916955b0c561d33f162e145094d39..7e0c6938bb0b3354efdadad5fbe738391dcb93c8 100644 (file)
@@ -164,10 +164,7 @@ verify_tree(int limit)
        char filename[260];
        char name1[260];
        char name2[260];
-       char contents[260];
        int i, j, LOOP_MAX;
-       FILE *f;
-       int len;
 
        LOOP_MAX = compute_loop_max();
 
@@ -186,18 +183,8 @@ verify_tree(int limit)
                strcpy(name1, "f/");
                strcat(name1, filename);
                if (limit != LIMIT_USTAR || strlen(filename) <= 100) {
-                       f = fopen(name1, "rb");
-                       failure("Couldn't open \"%s\": %s",
-                           name1, strerror(errno));
-                       if (assert(f != NULL)) {
-                               len = fread(contents, 1, i + 10, f);
-                               fclose(f);
-                               assertEqualInt(len, i + 2);
-                               /* Verify contents of 'contents' */
-                               contents[len] = '\0';
-                               failure("Each test file contains its own name");
-                               assertEqualString(name1, contents);
-                       }
+                       assertFileExists(name1);
+                       assertFileContents(name1, strlen(name1), name1);
                }
 
                /*
@@ -210,7 +197,7 @@ verify_tree(int limit)
                if (limit != LIMIT_USTAR || strlen(name2) <= 100) {
                        /* Verify hardlink "l/abcdef..." */
                        assertFileHardlinks(name1, name2);
-                       /* Verify hardlink "m_abcdef..." */
+                       /* Verify hardlink "m/abcdef..." */
                        name2[0] = 'm';
                        assertFileHardlinks(name1, name2);
                }
index abc3cfa65d35461e3cb3f1dfa178b566b74f0026..67a7bbd6105d475e6e21fa0e753aa7a67b9c3561 100644 (file)
@@ -410,7 +410,7 @@ tree_next(struct tree *t)
                        /* Top stack item needs a regular visit. */
                        t->current = t->stack;
                        tree_append(t, t->stack->name, strlen(t->stack->name));
-                       t->dirname_length = t->path_length;
+                       //t->dirname_length = t->path_length;
                        //tree_pop(t);
                        t->stack->flags &= ~needsFirstVisit;
                        return (t->visit_type = TREE_REGULAR);