diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-01-18 05:48:50 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-01-18 05:48:50 +0000 |
commit | 1bac8d44d3c2b4ff0262df98030ea0006d746167 (patch) | |
tree | 773a7452c4a10ed96cbf6f8845106329e2511633 /lib/libarchive/test | |
parent | fe18434231c3a45be41f61f97e2a9621b7170f9b (diff) | |
download | FreeBSD-src-1bac8d44d3c2b4ff0262df98030ea0006d746167.zip FreeBSD-src-1bac8d44d3c2b4ff0262df98030ea0006d746167.tar.gz |
The previous commit caused the archive_write_disk interface to
start obeying filesize limits; this test wasn't properly setting
file sizes before trying to write file data.
Diffstat (limited to 'lib/libarchive/test')
-rw-r--r-- | lib/libarchive/test/test_write_disk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libarchive/test/test_write_disk.c b/lib/libarchive/test/test_write_disk.c index fb805ff..ed83109 100644 --- a/lib/libarchive/test/test_write_disk.c +++ b/lib/libarchive/test/test_write_disk.c @@ -60,6 +60,7 @@ static void create_reg_file(struct archive_entry *ae, const char *msg) /* Write the entry to disk. */ assert((ad = archive_write_disk_new()) != NULL); failure("%s", msg); + archive_entry_set_size(ae, sizeof(data)); assertEqualIntA(ad, 0, archive_write_header(ad, ae)); assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data))); assertEqualIntA(ad, 0, archive_write_finish_entry(ad)); @@ -92,6 +93,7 @@ static void create_reg_file2(struct archive_entry *ae, const char *msg) /* Write the entry to disk. */ assert((ad = archive_write_disk_new()) != NULL); failure("%s", msg); + archive_entry_set_size(ae, datasize); assertEqualIntA(ad, 0, archive_write_header(ad, ae)); for (i = 0; i < datasize - 999; i += 1000) { assertEqualIntA(ad, ARCHIVE_OK, |