~ubuntu-branches/ubuntu/quantal/libarchive/quantal

« back to all changes in this revision

Viewing changes to libarchive/test/test_read_format_ar.c

  • Committer: Package Import Robot
  • Author(s): Andres Mejia
  • Date: 2012-02-23 19:29:24 UTC
  • mfrom: (8.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120223192924-73n4iedok5fwgsyr
Tags: 3.0.3-5
* Detect if locales or locales-all is installed for use with test suite.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
        extract_reference_file(reffile);
40
40
        assert((a = archive_read_new()) != NULL);
41
 
        assertA(0 == archive_read_support_compression_all(a));
 
41
        assertA(0 == archive_read_support_filter_all(a));
42
42
        assertA(0 == archive_read_support_format_all(a));
43
43
        assertA(0 == archive_read_open_file(a, reffile, 7));
44
44
 
58
58
        assertEqualInt(0, archive_entry_gid(ae));
59
59
        assert(8 == archive_entry_size(ae));
60
60
        assertA(8 == archive_read_data(a, buff, 10));
61
 
        assert(0 == memcmp(buff, "55667788", 8));
 
61
        assertEqualMem(buff, "55667788", 8);
62
62
 
63
63
        /* Second Entry */
64
64
        assertA(0 == archive_read_next_header(a, &ae));
68
68
        assertEqualInt(0, archive_entry_gid(ae));
69
69
        assert(4 == archive_entry_size(ae));
70
70
        assertA(4 == archive_read_data(a, buff, 10));
71
 
        assert(0 == memcmp(buff, "3333", 4));
 
71
        assertEqualMem(buff, "3333", 4);
72
72
 
73
73
        /* Third Entry */
74
74
        assertA(0 == archive_read_next_header(a, &ae));
78
78
        assertEqualInt(0, archive_entry_gid(ae));
79
79
        assert(9 == archive_entry_size(ae));
80
80
        assertA(9 == archive_read_data(a, buff, 9));
81
 
        assert(0 == memcmp(buff, "987654321", 9));
 
81
        assertEqualMem(buff, "987654321", 9);
82
82
 
83
83
        /* Test EOF */
84
84
        assertA(1 == archive_read_next_header(a, &ae));
85
 
        assert(0 == archive_read_close(a));
86
 
        assert(0 == archive_read_finish(a));
 
85
        assertEqualInt(4, archive_file_count(a));
 
86
        assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
 
87
        assertEqualInt(ARCHIVE_OK, archive_read_free(a));
87
88
}