Tim Kientzle [Sat, 29 Aug 2009 17:37:21 +0000 (13:37 -0400)]
This test requires a certain umask() setting but doesn't actually
set it. Since the immediately preceding test does set umask(), this
only shows up if you run this test by itself. (Or at least first.)
Tim Kientzle [Sat, 29 Aug 2009 04:08:13 +0000 (00:08 -0400)]
Merge r1396 from libarchive/trunk: significant rework of examples/untar.c,
the minimal libarchive-based untar.c program. (Not to be confused with
contrib/untar.c which is an even more minimal untar program that doesn't
use libarchive. I have got to rename one of them someday....)
Tim Kientzle [Thu, 27 Aug 2009 04:24:19 +0000 (00:24 -0400)]
If ftruncate() isn't available, we fall back to use
lseek()/write() to extend a file. Unfortunately, that
code was broken, as would be readily apparent to anyone who
ran the test suite on a platform that lacked ftruncate().
Tim Kientzle [Sun, 23 Aug 2009 04:16:58 +0000 (00:16 -0400)]
Test -T with varying end-of-line conventions, including --null -T with
a filename that includes a NL character. Fix the line parser in
util.c to correctly handle these cases.
Tim Kientzle [Thu, 23 Jul 2009 04:32:07 +0000 (00:32 -0400)]
Fix the test naming. The cmake-based builds assume that
we have exactly one official test case in each source file.
If that's violated, the tests report wrong names for failed tests.
Tim Kientzle [Thu, 23 Jul 2009 04:16:09 +0000 (00:16 -0400)]
Windows and Posix libarchive ports handle errors a little differently for external decompression programs; verify that the responses are reasonable, but don't be too rigid.
Charles Wilson [Wed, 22 Jul 2009 12:01:18 +0000 (08:01 -0400)]
Merge r1167 (part c) from trunk
Fix a bunch of tests on Visual Studio:
* Change off_t to int64_t for a lot of internal vars
to support VS 32-bit off_t; since we can't change
the external client_skip interface until libarchive 3.0,
just limit forward skips until then.
libarchive/archive_private.h
libarchive/archive_read.c
libarchive/archive_read_support_format_tar.c
Charles Wilson [Tue, 21 Jul 2009 04:02:52 +0000 (00:02 -0400)]
Merge r1176 from trunk
Clear any warning/error messages set by archive_read_support_compression_*
functions, since we're ignoring their return codes. This eliminates the
weird behaviour of printing "Using external unxz program for xz
decompression" if an unrelated error occurs when opening an archive (due
to the message lingering in the error message buffer).
------------------------------------------------------------------------
Charles Wilson [Tue, 21 Jul 2009 04:01:57 +0000 (00:01 -0400)]
Merge r1167 (part b) from trunk
Fix a bunch of tests on Visual Studio:
* Now that we have better handling for missing compression,
test_fuzz doesn't need to test whether it can handle
a file before it tries fuzzing it.
libarchive/test/test_fuzz.c
------------------------------------------------------------------------
Charles Wilson [Tue, 21 Jul 2009 03:57:55 +0000 (23:57 -0400)]
Merge r1167 (part a) from trunk
Fix a bunch of tests on Visual Studio:
* detect bzip2 unavailability and skip those tests
libarchive/test/test_read_format_cpio_bin_bz2.c
libarchive/test/test_read_format_pax_bz2.c
libarchive/test/test_read_format_tbz.c
------------------------------------------------------------------------
Charles Wilson [Tue, 21 Jul 2009 03:56:12 +0000 (23:56 -0400)]
Merge r1164 from trunk
Skip this test if libarchive isn't compiled with libbz2.
------------------------------------------------------------------------
Charles Wilson [Sun, 19 Jul 2009 23:20:47 +0000 (19:20 -0400)]
Merge r1220 from trunk:
Testsuite fixes for cygwin-1.5
* configure.ac: Detect cygwin-1.7.
* tar/test/test_copy.c: Better tuning for long filename tests.
Charles Wilson [Sun, 19 Jul 2009 23:10:39 +0000 (19:10 -0400)]
Merge r1084 from trunk:
Add custom _dosmaperr() implementation (copied from
PostgreSQL) and use it instead of the undocumented
Windows CRT function (which isn't available in all versions
of Windows CRT). Rename it to la_dosmaperr() to avoid
any name conflicts with the "standard" one.
Tim Kientzle [Fri, 12 Jun 2009 03:24:41 +0000 (23:24 -0400)]
It appears that liblzma truly does use the 'memlimit' argument
to lzma_stream_decoder() and lzma_alone_decoder() as an upper
limit on the amount of memory they will allocate, allocating
less if the stream uses less. So I don't see any reason to
not make this value very large.
Tim Kientzle [Mon, 25 May 2009 05:02:50 +0000 (01:02 -0400)]
Merge r1093 from trunk: Correctly account for
"extra data" field when reading gzip headers.
In particular, this fixes reading gzip files that
have been signed with the OpenBSD "gzsig" program.
Tim Kientzle [Thu, 7 May 2009 22:55:24 +0000 (18:55 -0400)]
Merge r1068 from trunk: This partially reverts r868, which
broke tar handling of end-of-file when reading from a pipe.
With this change, tar once again flushes input from a pipe
which avoids SIGPIPE getting sent upstream.
Tim Kientzle [Sun, 5 Apr 2009 05:24:45 +0000 (01:24 -0400)]
Rename the tests to a consistent style:
Test for -L = test_option_L_upper
Test for -B = test_option_B_upper
Test for -l = test_option_l
This should be reasonably legible and be sane
on case-insensitive systems.
Tim Kientzle [Sun, 5 Apr 2009 04:40:12 +0000 (00:40 -0400)]
Two new tests:
test_cmdline exercises some boundary cases in the cmdline parsing,
including ambiguous long options, missing arguments, etc.
test_option_C_upper exercises the -C option (the _upper is
to prevent filename conflicts with test_option_c on case-insensitive
systems).
Tim Kientzle [Sat, 4 Apr 2009 22:44:43 +0000 (18:44 -0400)]
Dynamically size the buffer used for getpwuid_r and
getgrgid_r. We allocate an initial buffer early
and then double it whenever we learn it is too small.
By keeping the buffer in the persistent cache state,
the cost should be very small.
Tim Kientzle [Thu, 2 Apr 2009 01:38:45 +0000 (21:38 -0400)]
The distribution contains a pre-built list.h that includes
test_windows.c. By default, cmake seems to pick up the
existing list.h instead of remaking it, so we'd better
always compile test_windows.c. It includes enough compile
guards that this is safe on all platforms.
Tim Kientzle [Wed, 1 Apr 2009 22:55:09 +0000 (18:55 -0400)]
Issue 18: Limit compression-level to 6 within the
write options processing. Restore the test to
exercise compression-level=9, which should work now
(even though the results should not be any different
than compression-level=6). In particular, all compression
writers should now accept a compression-level option
with values from 0 through 9.
Tim Kientzle [Wed, 1 Apr 2009 19:54:33 +0000 (15:54 -0400)]
Some cleanup and testing of the XZ and LZMA writer:
* Fix the options parser to use a separate config object.
* Set the compression code and name at setup time.
* Copy the gzip/bzip2 write tests to create new XZ and LZMA write tests
Tim Kientzle [Wed, 1 Apr 2009 07:36:15 +0000 (03:36 -0400)]
Have xz/lzma support fall back to the unxz/unlzma command-line utilities
if the libraries were unavailable at build time. Have the public setup
functions return ARCHIVE_WARN in this case. Update the tests to
detect this situation and simply skip the appropriate tests.
TODO: Update one of these tests to use systemf() to try
running the command-line tool; if we can find it, run the
test anyway. That will give us some coverage of the fallback
handling.
Tim Kientzle [Wed, 1 Apr 2009 07:32:55 +0000 (03:32 -0400)]
If the necessary libraries are missing for gzip/bzip2 writing,
have the public setup function return ARCHIVE_FATAL and a suitable
error message. Alter the write tests to simply skip if the
initial compression setup returns ARCHIVE_FATAL. This should
fix these tests on platforms without zlib/bzlib.
Tim Kientzle [Wed, 1 Apr 2009 05:48:09 +0000 (01:48 -0400)]
archive_read_support_compression_bzip2() now supports fallback to
bunzip2 command-line program if it is compiled without bzlib support.
It returns ARCHIVE_WARN in this case, so that the test harness
(or other clients) can detect this degraded state.
Tim Kientzle [Wed, 1 Apr 2009 04:52:48 +0000 (00:52 -0400)]
archive_read_support_compression_gzip() now returns ARCHIVE_WARN
if decompression is being handled via an external program.
This simplifies the many tests that need to check whether we have
full gzip support or not. While reworking these tests, I've also
updated the style of many of them to use assertEqualFoo() instead
of plain assert() and fixed an oversight in main.c that caused it
to print an alarm if a single skip was processed multiple times.
Tim Kientzle [Wed, 1 Apr 2009 01:49:08 +0000 (21:49 -0400)]
1. Make the UTF-8 <-> Unicode conversions more robust by
handling surrogate pairs correctly. This should be general
enough (and portable enough) to be used on all platforms,
even Windows, so I've removed the Windows-specific versions
of this.
2. On POSIX systems, prefer the thread-safe wcrtomb()
for Unicode <-> current locale conversions when it's
available; fall back to wctomb() where necessary.
Tim Kientzle [Wed, 1 Apr 2009 01:42:20 +0000 (21:42 -0400)]
Improve the error handling here just a bit by harvesting
the child (and collecting its exit status) whenever the
child closes stdout. By not waiting until archive_close,
we catch most cases of a failed child at the first
real I/O (usually archive_read_next_header).
I'm still investigating whether it makes sense to try
pushing this even earlier... It may be possible to
detect some child failures as early as read_open() time.