summaryrefslogtreecommitdiff
path: root/libarchive/test/test_read_pax_truncated.c
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize test code a bitTim Kientzle2022-02-011-1/+0
| | | | | | | | | | | | | | | | | | A few guiding principles: * Each test source file includes ONLY "test.h" to make it easy to create new tests. * Each test suite has a "test.h" that includes "test_util/test_common.h" to get access to all the common testing utility functions. So "test_common.h" is then responsible for including any smaller headers that declare specific pieces of shared test functionality. I've also pulled some test filtering logic that was _only_ used in test_main.c into that file, and repurposed "test_utils.[ch]" for common utility code. (Eventually, a lot of the assertion helpers currently in "test_main.c" should probably be organized into one or more source files of their own.)
* Avoid millions of rand() calls() when running testsAlex Richardson2022-01-151-2/+3
| | | | | | | | | | | | | | | Many tests use a loop calling rand() to fill buffers with test data. As these calls cannot be inlined, this adds up to noticeable overhead: For example, running on QEMU RISC-V the test_write_format_7zip_large_copy test took ~22 seconds before and with this change it's ~17 seconds. This change uses a simpler xorshift64 random number generator that can be inlined into the loop filling the data buffer. By default the seed for this RNG is rand(), but it can be overwritten by setting the TEST_RANDOM_SEED environment variable. For a native build the difference is much less noticeable, but it's still measurable: test_write_format_7zip_large_copy takes 314.9 ms ± 3.9 ms before and 227.8 ms ± 5.8 ms after (i.e. 38% faster for that test).
* Add printf attributes to the printflike functions used in tests and fixzoulasc2020-01-231-3/+3
| | | | | | the format errors. Closes #1318
* Stop using deprecated functions. Much remains to be replaced.Michihiro NAKAJIMA2012-10-071-1/+1
| | | | s/archive_write_set_compression_/archive_write_add_filter_/
* Rename read_open_memory2 to read_open_memory_minimal, which isTim Kientzle2012-01-231-2/+2
| | | | | | a bit more descriptive. SVN-Revision: 4192
* tests use archive_read_support_filter_*()Roman Neuhauser2011-03-281-9/+9
| | | | SVN-Revision: 3114
* Issue 141: Detect an unrecognized format earlier, in archive_read_open,Tim Kientzle2011-03-131-36/+50
| | | | | | | | | | | | instead of waiting until we try to read the first header. This just required moving the format detection into archive_read_open. This in turn required updating a some tests that inadvertently relied on the old behavior. While poking around in the truncation tests, I went ahead and updated them to not use the old "assertA" macro, which is deprecated. SVN-Revision: 3009
* Rename archive_read_finish to archive_read_free andTim Kientzle2010-02-081-10/+10
| | | | | | | | | | | | | archive_write_finish to archive_write_free. Update all clients, tests, and documentation to use the new names exclusively. (Though I've not yet run a global search-and-replace against the Wiki. I'll do that shortly.) I've preserved the old names as aliases, scheduled to be removed with libarchive 4.x, so there is no immediate impact to existing code from this change. SVN-Revision: 1891
* Style: Update a bunch of old assert() and assertA() calls.Tim Kientzle2010-02-071-20/+20
| | | | SVN-Revision: 1887
* Rip out the remaining support for old libarchive 1.x APIs.Tim Kientzle2010-02-071-40/+0
| | | | SVN-Revision: 1886
* Sync $FreeBSD$ version info from FreeBSD SVNTim Kientzle2009-12-301-1/+1
| | | | SVN-Revision: 1786
* Add a variant of read_open_memory() that does not register open,Tim Kientzle2009-02-251-1/+1
| | | | | | | | | | | | skip, or close callbacks. Use this in read_pax_truncated to partially verify extraction with clients that only register a minimal set of callbacks (recall that only the read callback function is mandatory; in fact, the open callback is deprecated and will likely be removed in libarchive 3.0). Debian bug #516577 SVN-Revision: 714
* Fix signed/unsigned mismatch.Tim Kientzle2009-02-211-2/+3
| | | | SVN-Revision: 690
* Fix a type mismatch.Tim Kientzle2009-02-091-3/+3
| | | | SVN-Revision: 596
* IFCTim Kientzle2008-12-051-1/+1
| | | | SVN-Revision: 266
* Make a couple of tests a bit more informative and a bit more robust.Tim Kientzle2008-10-191-4/+10
| | | | SVN-Revision: 224
* IFCTim Kientzle2008-09-011-31/+31
| | | | SVN-Revision: 193
* IFC to populate initial libarchive-portable tree.Tim Kientzle2008-04-291-0/+281
SVN-Revision: 1