Tim Kientzle [Mon, 29 Dec 2008 06:47:01 +0000 (01:47 -0500)]
Visual Studio lacks getopt(). Fortunately, the
test suite only requires fairly basic argument parsing,
so just add the dozen lines needed to implement it from
scratch.
Tim Kientzle [Mon, 29 Dec 2008 01:59:44 +0000 (20:59 -0500)]
Compatibility, based on Windows compatibility fixes from Michihiro NAKAJIMA:
* We don't actually need the name we were run as; we can just use our expected program name (removes need to parse argv[0])
* Add some platform-specific setup on Windows
* Use getcwd() instead of trying to fork pwd shell command; this may need a bit more tweaking on Windows
Tim Kientzle [Mon, 29 Dec 2008 00:45:58 +0000 (19:45 -0500)]
Use native conversion functions on Windows which
handle UTF-16 encoding correctly.
I have two concerns about the current code:
* Windows isn't unique in using UTF-16. Its just a
couple lines of code to combine surrogate pairs
prior to converting to UTF-8. Its another couple
of lines to expand surrogate pairs when converting
from UTF-8 (but only if sizeof(wchar_t) == 2).
* mbtowc() isn't thread-safe. Although there are
parts of libarchive that aren't thread safe---in
particular, archive_write_disk has some umask()
and chdir() calls that are hard to avoid---most
of libarchive can be made thread safe with a little
care. I originally switched this code to mbtowc()
style for reasons of portability and error handling,
so some care is needed.
Tim Kientzle [Mon, 29 Dec 2008 00:36:39 +0000 (19:36 -0500)]
Handle surrogate pairs properly when encoding UTF-8.
In particular, this gives us correct encoding of non-BMP
values on platforms such as Windows whose native wide
character representation is UTF-16.
Tim Kientzle [Mon, 29 Dec 2008 00:24:22 +0000 (19:24 -0500)]
Use MultiByteToWideChar() on Windows instead of mbstowcs().
I'm not yet convinced about this approach. Microsoft documents
mbstowcs(); I'd prefer to avoid platform conditionals.
Tim Kientzle [Mon, 29 Dec 2008 00:13:57 +0000 (19:13 -0500)]
Updated Visual Studio solution files, including
projects for libarchive_test. I'm still working
through the rest of Michihiro's fixes for getting
libarchive_test working under Visual Studio.
Tim Kientzle [Sun, 28 Dec 2008 23:54:08 +0000 (18:54 -0500)]
Skip a test for handling of invalid characters if the
local platform's "C" locale has no invalid characters.
In particular, this fixes libarchive_test on Cygwin.
Tim Kientzle [Sat, 27 Dec 2008 22:06:33 +0000 (17:06 -0500)]
IFC: Various style corrections to libarchive_test: Use more
informative assertXxxx macros; rework some tests so they give
up before failures get out of hand.
Tim Kientzle [Thu, 25 Dec 2008 14:41:32 +0000 (09:41 -0500)]
The EXT2 ioctls are used on Linux to get/set file flags.
The header defining these exists on some Cygwin installations,
but it's broken. I don't think Cygwin supports these ioctls
anyway, so I don't see any point in including the header there.
Someone with more autoconf-fu than I have probably knows a better
solution to this problem.
Tim Kientzle [Thu, 25 Dec 2008 14:31:49 +0000 (09:31 -0500)]
Straighten out the close handling. archive_read_close() now
walks the decompression filter list, invoking the close handler
on each one. In particular, this means that the compress handler
should not recursively invoke close on it's source.
Tim Kientzle [Sun, 21 Dec 2008 19:02:56 +0000 (14:02 -0500)]
Reduce the number of file patterns tested from 200 to 170.
This seems to be necessary in order to run the tests on Cygwin. (?)
Submitted by: Michihiro NAKAJIMA
Tim Kientzle [Sun, 7 Dec 2008 11:42:15 +0000 (06:42 -0500)]
Provide configure options to suppress use of zlib, bzlib, and lzmadec.
There are a few issues that should be addressed: The test suites
shouldn't rely so heavily on gzip support; zip decoder should
have a private CRC calculation so it can read (uncompressed) zip
archives without zlib.
Submitted by: Diego Petten\242
Tim Kientzle [Sun, 7 Dec 2008 11:40:32 +0000 (06:40 -0500)]
The new and improved cpio -tv output relies on local system
conventions, so a naive file comparison can't be used to test
it. Someday, I'll put together code to carefully parse and verify
the format. Until then, at least shut up the bogus warnings.
Submitted by: Diego Petten\242
Tim Kientzle [Thu, 4 Dec 2008 21:58:03 +0000 (16:58 -0500)]
Basic test for gzip compatibility.
I've commented out the test for handling concatenated gzip streams,
as it appears I need to do more work on refactoring the read
filter framework before this is reasonable to implement.
Fortunately, concatenated gzip streams are uncommon.
Tim Kientzle [Sat, 22 Nov 2008 22:02:45 +0000 (17:02 -0500)]
Add a fuzz tester to the libarchive test suite. This
takes known-good archives, changes random bytes, then feeds
them through libarchive trying to provoke a crash or hang.
This has exposed a couple of problems reading malformed
ISO9660 images. As a result, I now have a rewritten
Rockridge extension parser, better handling of malformed
PVDs, and some additional checks around end-of-archive conditions.
Tim Kientzle [Tue, 18 Nov 2008 16:14:08 +0000 (11:14 -0500)]
Rework Bzip2 stream management. Mostly, this makes the stream
initialization lazy so we can re-open the decompressor for
a new stream. This should allow us to read pbzip2 output,
which compresses large blocks separately and writes them
as independent streams, while still handling files such as
Gentoo binary packages, which store unrelated data after the
end of the bzip2 data.
Thanks to: Ivan Voras for pointing out the pbzip2 case
Thanks to: Diego "Flameeyes" Petteno for pointing out
the problem with Gentoo binary packages
Tim Kientzle [Sun, 9 Nov 2008 18:00:18 +0000 (13:00 -0500)]
Update NEWS with a few of the things that have happened
since 2.5.5 was released. I still need to dig through old
commit messages to fill this in further before releasing 2.6.0.
Bump the version numbers to 2.5.901 to reflect the pre-release
status. Bump bsdcpio version to 1.1.0.
Tim Kientzle [Sun, 9 Nov 2008 17:45:24 +0000 (12:45 -0500)]
Add LZMA test, more detailed comments about the sorry state
of LZMA magic number checks, update Makefiles to include
lzma reader and lzma test.
Because LZMA support is optional, the lzma test is pretty forgiving
about failures at open time. It does report the skip (including
the underlying libarchive failure) which should reduce the risk of
false passes somewhat.