summaryrefslogtreecommitdiff
path: root/libarchive/test/test_read_large.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-3/+2
| | | | | | | | | | | | | | | 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).
* Fixup a couple of tests that relied on the old read_data_into_buffer,Tim Kientzle2011-12-221-1/+2
| | | | | | which I removed recently. SVN-Revision: 3956
* Use assertEqualMem instead of assert(0 == memcmp(xxx....)).Michihiro NAKAJIMA2011-05-121-2/+2
| | | | SVN-Revision: 3316
* tests use archive_read_support_filter_*()Roman Neuhauser2011-03-281-2/+2
| | | | SVN-Revision: 3114
* Rename archive_read_finish to archive_read_free andTim Kientzle2010-02-081-3/+3
| | | | | | | | | | | | | 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-3/+3
| | | | SVN-Revision: 1887
* On Borland C, elimimate the warnings of comparing signed and unsigned from ↵Michihiro NAKAJIMA2010-01-071-1/+1
| | | | | | libarchive_test. SVN-Revision: 1810
* Sync $FreeBSD$ version info from FreeBSD SVNTim Kientzle2009-12-301-1/+1
| | | | SVN-Revision: 1786
* r1729 was wrong. Revert it and use a better approach.Tim Kientzle2009-12-131-7/+6
| | | | SVN-Revision: 1730
* Work around Borland C's broken _open() implementation.Tim Kientzle2009-12-121-0/+4
| | | | SVN-Revision: 1729
* Use assertEqualInt instead of assert.Michihiro NAKAJIMA2009-11-171-1/+2
| | | | | | Suggested by Tim SVN-Revision: 1668
* Avoid compiling error on linux.Michihiro NAKAJIMA2009-11-161-1/+1
| | | | SVN-Revision: 1666
* Another step towards clean Windows builds: libarchive, libarchive_test, and ↵Tim Kientzle2009-08-021-0/+5
| | | | | | bsdtar_test all build cleanly now under both Visual C++ and MinGW. SVN-Revision: 1305
* Portability refactoring of a few more libarchive tests.Tim Kientzle2009-07-261-17/+6
| | | | SVN-Revision: 1284
* Be more careful about text/binary mode.Tim Kientzle2009-05-241-2/+3
| | | | | | | | | | | | | | | | | | Libarchive is already pretty careful about using O_BINARY whenever it opens a file handle internally; this extends that care to file descriptors that are passed in from clients by invoking _setmode() explicitly. The test harness was much less careful about O_BINARY; this adds those flags to all open() calls and modifies fopen() calls to use "wb" and "rb" explicitly. In particular, this should remove the need for clients to use invoke _set_fmode() at all. This is not yet completely tested... SVN-Revision: 1103
* Fix the open file flags.Tim Kientzle2008-12-281-1/+1
| | | | SVN-Revision: 323
* Don't put temp files directly into /tmp; the testTim Kientzle2008-12-281-1/+1
| | | | | | | harness has already created and chdir() into a suitable temporary directory. SVN-Revision: 312
* IFCTim Kientzle2008-09-011-10/+10
| | | | SVN-Revision: 193
* IFC to populate initial libarchive-portable tree.Tim Kientzle2008-04-291-0/+94
SVN-Revision: 1