• Home
  • History
  • Annotate
  • only in /libcore/luni/src/test/java/libcore/java/util/zip/
History log of /libcore/luni/src/test/java/libcore/java/util/zip/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8456b1f15317e7fd59267ab8cafe0a78f1d5b1a0 27-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Enable a few black listed tests

Removed UrlUtilsTest as the class has been removed.
commit ca31a11 fixes X509CertificateTest. ZipEntryTest has
been re-added with a few modifications.

Bug: 26352408
Bug: 26870388
Change-Id: I10b58ee2ded9f6ccccb7af5c3729eec465795650
ipEntryTest.java
cc42201b8d47d4c03a69dcf6df4e58c1a11d32e5 21-Dec-2015 Paul Duffin <paulduffin@google.com> Deleting unused or broken files

The tests removed from luni/src/test are testing files that no
longer exist. It's possible that they provided some coverage of
the code which is not provided for the OpenJDK code.

The classes removed from ojluni/src/main are the ones not
explicitly mentioned in the openjdk_java_files.mk.

Change-Id: Id52d65d9b1f06e1a6e7afbd93336c7d12e0c3083
ip64Test.java
70b617fe562806bc3e15452a2792fec4355bd54f 20-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge mnc-dr-enso-dev into master

OpenJDK adjustments for master.
- Restored removed libcore.icu.* classes (needed
by the openjdk java.text.* classes). This will be
undone in short future.
- Adjusted java.lang.* and java.lang.reflect.* classes
for native reflection and other changes in master.

Bug: 25758743
Change-Id: Ifbbe5b1e8661138fc32ad24127f76f711dd585b7
bf07204bff37fa34dbdb32e0a9d790d97ef46a81 12-Nov-2015 Narayan Kamath <narayan@google.com> Merge lmp changes into mnc.

Change-Id: I8f49c58f39dc5f4268c6b5718cab18ed26ac930a
b97322e9be86ba338ace9d8c661b27376b6805a3 14-Aug-2015 Narayan Kamath <narayan@google.com> Tweak GZIPInputStreamTest.

To match slightly different heuristics wrt. trailing data at the
end of files.

Change-Id: I36f86fe5520c39e2221a8d27676df3b3a30d9305
ZIPInputStreamTest.java
e8d8f9ceef8b9e05dc8d55ba2ff838ed8a9ed50d 03-Aug-2015 Narayan Kamath <narayan@google.com> Minor tweak to DeflaterOutputStreamTest.

Don't use reflection to set flush params. Instead construct a deflater
that always uses SYNC_FLUSH when no flush value is specified.

(cherry picked from commit 3e2415c8a33ad147352176a0e98e43a8bbd5fb11)

Change-Id: I54597f1d4858cb033004ab81cb09507f3160caae
eflaterOutputStreamTest.java
adc40417389a57bc7a831f55334bffcc07343eb9 21-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Fix unit tests from java.util.{zip, logging, prefs}.*

- zip64 is now supported.
- LogManager: use getResourceAsStream for logging.properties.
- MemoryHandler : use context classloader for loading properties.
- ZipEntry : Explicitly use UTF-8 for names and comments.

- ZipFile :
- Error out early if the file is too short..
- .. or if the file has zero zip entries.
- .. or if the file has two entries with the same name.
- .. or if any the entries have a C string terminator in their name.

Change-Id: Ie0cdb3d9dd5f12181507b20fc239bba3b2b9b374
ipFileTest.java
8fa441e012af2cad6d7b374147d708f55bffe44f 03-Aug-2015 Narayan Kamath <narayan@google.com> Merge "Minor tweak to DeflaterOutputStreamTest."
3e2415c8a33ad147352176a0e98e43a8bbd5fb11 03-Aug-2015 Narayan Kamath <narayan@google.com> Minor tweak to DeflaterOutputStreamTest.

Don't use reflection to set flush params. Instead construct a deflater
that always uses SYNC_FLUSH when no flush value is specified.

Change-Id: I996a3e89c52c47432a781df1dbc44a462d5137ae
eflaterOutputStreamTest.java
6b37f0bb40c3789833a9fd02c321d68354c6ecaf 31-Jul-2015 Narayan Kamath <narayan@google.com> Fix broken Zip64 extended info size checks.

We assumed that all fields listed in the extended info layout were
always present. This is not the case. Only the size / uncompressed
size are required fields (in the LFH) and the directory offset is
required only if the corresponding field in the regular record is
0xFFFFFFFF. The same goes for disk number too, but we don't support
spanned archives, so we can assume that it's never present.

This change also fixes a spec violation where we were *not* writing
0xFFFFFFFF to the central directories LFH offset field when we were
putting the actual information in the Zip64 Extended info field.

This change also adds lower level unit tests to some of the Zip64
parsing functions since it's pretty hard (impossible ?) to find a
Zip64 tool that outputs stuff in the format we want.

bug: 22851464

(cherry picked from commit 837aeb356c331960073e5ddbf449779c6194f164)

Change-Id: I031b3151b7deeda8a0a98acfba3f5a906c0c360c
ip64Test.java
837aeb356c331960073e5ddbf449779c6194f164 31-Jul-2015 Narayan Kamath <narayan@google.com> Fix broken Zip64 extended info size checks.

We assumed that all fields listed in the extended info layout were
always present. This is not the case. Only the size / uncompressed
size are required fields (in the LFH) and the directory offset is
required only if the corresponding field in the regular record is
0xFFFFFFFF. The same goes for disk number too, but we don't support
spanned archives, so we can assume that it's never present.

This change also fixes a spec violation where we were *not* writing
0xFFFFFFFF to the central directories LFH offset field when we were
putting the actual information in the Zip64 Extended info field.

This change also adds lower level unit tests to some of the Zip64
parsing functions since it's pretty hard (impossible ?) to find a
Zip64 tool that outputs stuff in the format we want.

bug: 22851464
Change-Id: I3474fe501d0b7d5b91803976fd0b59d06fa127e8
ip64Test.java
28e3dec0da4a2dd9852fa05120273d1e2271f05f 24-Jun-2015 Narayan Kamath <narayan@google.com> InflaterInputStream : deflated streams are self limiting.

We call fill() whenever the Inflater needs more input. If the inflater
needs more input, reaching the end of the underlying stream is an error
that must be propagated to the caller.

bug: 21846904
Change-Id: If46cf7837df3a509b20fea8819e09f9a597905a5
ipInputStreamTest.java
a1938dec320283543ee7faeb459a2fd372ceeb4e 24-Jun-2015 Narayan Kamath <narayan@google.com> zip64: Exercise getInputStream(ZipEntry) for files with > 65k entries.

bug: https://code.google.com/p/android-developer-preview/issues/detail?id=2436
Change-Id: I9243de6f73e14207b31818c5c8dc62e4225249c1
ip64FileTest.java
b6d280493ffca2b63c7b850360309521af2b962e 03-Apr-2015 Narayan Kamath <narayan@google.com> GZIPInputStream: Correctly handle extras in gzip headers.

We were peeking into the wrong field for the extra length.

bug: https://code.google.com/p/android/issues/detail?id=159340
Change-Id: Ib7ed400e3e119b1d6c95be49d25812c5c7f366b9
ZIPInputStreamTest.java
fe3469f59ea823c2ddb2671a4fe0568b25c83df6 03-Apr-2015 Narayan Kamath <narayan@google.com> GZIPInputStream: Fix handling of header CRCs.

This is the same mistake as public bug 159340, we were peeking
in the wrong buffer for the CRC.

Note that this is different from the member CRC, the latter is
the CRC of the actual data (not the header) and is mandatory.

Change-Id: I98d49bdd9d5ea93fe982783c8077531764ee5347
ZIPInputStreamTest.java
a812a87e69850d1492c45bd88d7ff3dbf21d5075 24-Mar-2015 Narayan Kamath <narayan@google.com> Don't use zip64 by default.

This change was breaking tools like dexmaker that would write
zipfiles to disk so that the runtime could read them.

We don't want to go back and amend the local file header, so
we just throw an IOException if somebody writes more than 4GB
of data to an entry that doesn't have a declared size. If the
entry has a declared size > 4GB, we can write the zip64 header
in advance.

bug: 19574093
Change-Id: I771e821996efd3ef4c3de5e02f5a0062e62f9244
bstractZipFileTest.java
ip64FileTest.java
ipEntryTest.java
ipFileTest.java
ipOutputStreamTest.java
12f5c69e074d6ef012706068416f0a61b70b4e52 27-Jan-2015 Narayan Kamath <narayan@google.com> Implement zip64 support for ZipFile/ZipInputStream/ZipOutputStream.

There are several open questions that I hope to resolve in future
changes :

- Our heuristics for detecting whether a zip outputstream should
switch over to zip64 or not are imprecise.

- Also, given that we now officially support zip64, we have to assume
new entries whose size is unknown need the zip64 header / footer.
This will make output files slightly larger and less compatible with
older tools. If we don't do this, we'll have to go back and rewrite &
compact parts of the stream we'd already flushed, which isn't always
possible. The other option is to assume zip32 for streams of unknown
length and throw if more than 4G of data is written to them.

Change-Id: Ibb4a97b5f83fd3ab850d7c407ecfda663968a6b9
ipEntryTest.java
ipFileTest.java
5ccb2b3621f633708eb3ae1fd0f27f88bdb32a9d 29-Jan-2015 Narayan Kamath <narayan@google.com> Fix deflater in / out counts for inputs > 4G.

The underlying inflate & deflate can process any amount of data
correctly, since the protocol is chunk based (the size of each
chunk is limited to 32 bits, usually) and there is no limit to
the number of chunks.

On LP32, the stream counters are limited to 32 bit counts and
the manual recommends that the caller maintain their own counters
to support larger counts.

<quote>
Note however that the strm.total_in and strm_total_out counters may be
limited to 4 GB. These counters are provided as a convenience and are
not used internally by inflate() or deflate(). The application can
easily set up its own counters updated after each call of inflate()
or deflate() to count beyond 4 GB.
</quote>

Change-Id: I066e1141935154773360c1b9f94c56bd604f8474
eflaterTest.java
nflaterTest.java
1925e7d192641bc9cfa6a347a2ba567d61856322 29-Dec-2014 Narayan Kamath <narayan@google.com> Add a test for bug 18644314.

bug: 18644314
Change-Id: I7eaf8f636c22e6c429af0686e3445eae3cd00d96
ipFileTest.java
63744c884dd4b4f4307f2b021fb894af164972af 17-Jun-2014 Elliott Hughes <enh@google.com> Remove.

Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
ipFileTest.java
ipInputStreamTest.java
ipOutputStreamTest.java
3537f5811df63fa05faeca2bb85364dd03322fca 12-Mar-2014 Neil Fuller <nfuller@google.com> Merge "Add Java 1.7 APIs: ZipFile, ZipInputStream, ZipOutputStream"
e3d756c5dae1af2aa5f0ad8bc7f133df3e7401eb 11-Mar-2014 Neil Fuller <nfuller@google.com> Add Java 1.7 APIs: ZipFile, ZipInputStream, ZipOutputStream

Add constructor support for the character encoding to use.

When reading a ZipFile this is used for the file comment and for
entry names and comments when a zip entry is not self-described
as UTF-8 encoded.

When writing a zip file the character encoding determines the
encoding used for the file comment, entry names and comments.

The default for reading and writing when the character encoding
is not specified remains as UTF-8.

Additional fix:
ZipOutputStream: null comments no longer cause NullPointerException.

Change-Id: I7cadfa939377d0f87fd5503dae2a0b2dbac2ba39
ipFileTest.java
ipInputStreamTest.java
ipOutputStreamTest.java
bb65253db600d05ca6eeedc6d076f6af20680f99 10-Mar-2014 Narayan Kamath <narayan@google.com> Use the correct buffer size for the Pushback stream.

The maximum number of bytes we can push back to the
stream is the actual size of the DeflaterInputStream
buffer (buf.length) and not the default size (BUF_LENGTH).

bug: https://code.google.com/p/android/issues/detail?id=66409
Change-Id: I78a80b6ced8606602361abd8a969fa6f8227596c
ZIPInputStreamTest.java
ef164bf196538c04f499dcbb49a389c70ff5601a 26-Feb-2014 Paul Duffin <paulduffin@google.com> Improve error message when attempting to open an empty zip

The bug report states that the behaviour of ZipFile has changed between 4.3 and
4.4 when opening an empty zip file. I did some investigation and it appears as
though the reference implementation also throws an exception in that case so I
decided that 4.4 is working as designed. However, to make it clearer I made a
minor change to explicitly check for an empty zip file so that we can report a
slightly improved message explaining that they are not supported. I added a
test for various forms of empty streams and zip files and removed part of an
older test from harmony tests as it is no longer necessary.

Bug: https://code.google.com/p/android/issues/detail?id=65380
Change-Id: I1f2fcbf6bbaedb7dbccf8dd4f1cec4e330274524
ipFileTest.java
ipInputStreamTest.java
ipOutputStreamTest.java
2b7c83942a5e28c53698232182193d5118028e6c 18-Feb-2014 Narayan Kamath <narayan@google.com> Fix another set of file related tests.

- Get rid of Support_PlatformFile, use File.createTempFile
instead.
- Replace numerous uses of "user.dir" / "user.home" etc. with
File.createTempFile
- Replace calls to Process / chmod with Libcore.os.chmod. The
calls wouldn't have worked anyway, since chmod on android
doesn't understand the incremental (+w, -x) syntax.

Change-Id: Ic6944568bbee6a548da6dcb4364b882636f2959f
ldZipFileTest.java
8a246b1fceebc62282122680e11fe08d4f36b239 20-Dec-2013 Narayan Kamath <narayan@google.com> Allow multiple gzip members in gzip streams.

We look for the gzip magic bytes at the end of every
member and try to decompress the remainder of the
stream if we find it.

Note that this changes the behaviour of this class wrt.
the underlying stream: It is no longer self limiting. It
will attempt to read past the gzip trailer to look for
more data to decompress. Before this change, it would've
been possible to (hackily) consume the rest of the compressed
stream directly by inspecting the value of
InflaterInputStream.inf.getRemainingBytes(). It's no longer
possible to sensibly support that.

bug: https://code.google.com/p/android/issues/detail?id=63873

Change-Id: I818f77c052a811ed98b76243f2ad8a1a4d236d70
ZIPInputStreamTest.java
86ffcb99f901809c923fc8f1dbce0d39a9cf6080 22-Nov-2013 Narayan Kamath <narayan@google.com> Fix stream flushing when SYNC_FLUSH is set.

bug: https://code.google.com/p/android/issues/detail?id=62589
Change-Id: I8d569b8ecf21857df5f3d1e8ad88cd95139ab09c
ZIPOutputStreamTest.java
574d4b1c619d802347b36c968758b1672268f681 21-Aug-2013 Kenny Root <kroot@google.com> am 99aaedc2: Merge "Fix extra and comment ordering in ZipEntry reading"

* commit '99aaedc26d15bff0760ecb44e5e80d399f5cd691':
Fix extra and comment ordering in ZipEntry reading
c242577b1569f97f806ef176e4549141df147b78 21-Aug-2013 Kenny Root <kroot@google.com> Fix extra and comment ordering in ZipEntry reading

Change-Id: I99e6722ef898baa7f9a2d56e84e88aae5a6c9f4a
ipEntryTest.java
7662decc8f730fa91ea12001d75159a91f928fa0 13-Aug-2013 Elliott Hughes <enh@google.com> am 9bd449c8: am 5098d4f6: Fix build.

* commit '9bd449c8b788bd7e819f3a3c946a4c6127ea30e1':
Fix build.
9bd449c8b788bd7e819f3a3c946a4c6127ea30e1 13-Aug-2013 Elliott Hughes <enh@google.com> am 5098d4f6: Fix build.

* commit '5098d4f6ac9b6a538306b9e7ff6eb30c718f0407':
Fix build.
5098d4f6ac9b6a538306b9e7ff6eb30c718f0407 13-Aug-2013 Elliott Hughes <enh@google.com> Fix build.

I included a duplicate copy of a test in the merge of the bumper zip file
patch.

Change-Id: Ic082416671d6c26108b2d9848b57404f14bc3c7f
ipFileTest.java
b70d0551100794ca2687bec0115571f9fab52fe4 13-Aug-2013 Elliott Hughes <enh@google.com> resolved conflicts for merge of 465008a4 to jb-mr2-dev-plus-aosp

Change-Id: Ic74f1a90347998122c69b312cb591ecbf09323de
15fd7684de1af7d5f9e76d5bb8695c1fda036ad0 13-Aug-2013 Elliott Hughes <enh@google.com> resolved conflicts for merge of 6ee07507 to jb-mr1-dev-plus-aosp

Change-Id: Iea67d0b1dd161ea565d31af29f15ee5c1892915e
44e8930b48015aacbad027c5a8d9a4c7e00e329e 06-Aug-2013 Elliott Hughes <enh@google.com> Bumper ZipFile/ZipEntry backport.

Bug: https://code.google.com/p/android/issues/detail?id=58465
Bug: 8219321
Bug: 8476102
Bug: 8617715
Bug: 9695860
Bug: 9950697
Bug: 10148349
Bug: 10227498
Change-Id: I94c3e9664a429c94c336115618a46283a13996e0
ipFileTest.java
2450383af2b0e5197f580062106679245c15d786 08-Aug-2013 Chad Brubaker <cbrubaker@google.com> Add test for STORED zip entry stream size

Tests that the size used for the InputStream from ZipFile.getInputStream
is the uncompressed size and not the compressed size.

Bug: 10227498
Change-Id: Ibc98fe0d8f8c4d6067d675d66432a9dbcc5a7b8d
(cherry picked from commit e7f25b341118d89b7353be90c8bc244f3fc87689)
ipFileTest.java
8405b26225d88812bb336b2b6c0181266768c3f0 06-Aug-2013 Elliott Hughes <enh@google.com> Disallow filenames containing NUL bytes.

C code gets confused by such filenames, and even if we can handle them,
they're a misleading and of questionable utility because a valid pathname
can't contain a NUL byte.

Bug: https://code.google.com/p/android/issues/detail?id=58465
Bug: 10148349
Change-Id: I3f7e1a17c526b6bb5752dae82610125ad2648d54
(cherry picked from commit b1d05573ae20cdd3d5b4e25f905ce44c8f7d5c0e)
ipFileTest.java
941e382b6191b92fada482e58e2a0378d4552223 06-Aug-2013 Elliott Hughes <enh@google.com> Clean up a test slightly.

Change-Id: I9ac48591069037a51e95bb57eebb868d225caf6d
ipFileTest.java
5aced732888f8737c9c30ddf6e2e16ee911c4a54 11-Jul-2013 Elliott Hughes <enh@google.com> am c1ee1ac7: am 99663789: am b3e2cc46: am adf25974: am 15a93894: Tests for ZIP sign extension bugs.

* commit 'c1ee1ac7ff5dd966a90b1524232db6406bbd42fd':
Tests for ZIP sign extension bugs.
15a93894f19b27f3d85b8e3c3de8cff8a33964d3 09-Jul-2013 Elliott Hughes <enh@google.com> Tests for ZIP sign extension bugs.

Bug: 9695860

(cherry picked from commit 406b85296a7ba29d2f480280d2f2a96133f940ec)

Change-Id: If9740163a67c2bccebd46552fbba0518087232ba
ipEntryTest.java
e9de0dc2087de87074a3bb5a6391d9ca1bda79af 09-Jul-2013 Elliott Hughes <enh@google.com> am 210b16cc: Merge "Tests for ZIP sign extension bugs."

* commit '210b16cc87df9eae4f1a9360912a16b8d06821ff':
Tests for ZIP sign extension bugs.
406b85296a7ba29d2f480280d2f2a96133f940ec 09-Jul-2013 Elliott Hughes <enh@google.com> Tests for ZIP sign extension bugs.

Bug: 9695860
Change-Id: I61e5a932d73c14b964c44e753c7317b532b51b6d
ipEntryTest.java
dc36678d3ba7d256a79caf6c401e5fcee8b7d30d 29-Jun-2013 Elliott Hughes <enh@google.com> am c5cd81d1: Merge "Implement ZipFile.getComment."

* commit 'c5cd81d198a2c8196077af6d544bbe6daf02b421':
Implement ZipFile.getComment.
820c09bae53d20c5954d544ebc8a6ee8e54abbae 29-Jun-2013 Elliott Hughes <enh@google.com> Implement ZipFile.getComment.

Bug: 3484927
Change-Id: I30c30799aed1b3bbd1b2c90825685cea457600d1
ipFileTest.java
d5ff78bee6dcc6428bdbd44f04146f1987e7fb46 29-Jun-2013 Elliott Hughes <enh@google.com> am 52ac4053: Merge "Add syncFlush support to GZIPOutputStream."

* commit '52ac40530506afe4c5a85d370e04ee77e523b1fa':
Add syncFlush support to GZIPOutputStream.
35f9da25ee063a0d0c32f7246b466cff8e57c9ee 29-Jun-2013 Elliott Hughes <enh@google.com> Add syncFlush support to GZIPOutputStream.

Bug: 3484927
Change-Id: I9a2702970fe746b1f6bbbb438e4ce830e916bad4
eflaterOutputStreamTest.java
ZIPOutputStreamTest.java
51d669984f4a4c721ed1519cca838f0dc29258c6 04-Mar-2013 Geremy Condra <gcondra@google.com> Merge commit '6425eaad' into manualmerge

Change-Id: Iad87f3a194f585618a74338914c8a228e50fa72f
c7bcde8fbc5cff6de0b2581ebf7398c83e999410 19-Feb-2013 Geremy Condra <gcondra@google.com> Remove support for duplicate file entries.

Bug: 8219321
Change-Id: Ibc56bea753917c38e1bb20df48aa45fdff39d364
ipFileTest.java
38cad1eb5cc0c30e034063c14c210912d97acb92 19-Feb-2013 Geremy Condra <gcondra@google.com> Remove support for duplicate file entries.

Bug: 8219321
Change-Id: I4ac47f8facf13afa45799a0d5e20202a0ef5f0c6
ipFileTest.java
13f30b9167639ad63da1707102db6320e8f76474 08-Dec-2012 Elliott Hughes <enh@google.com> Clean up ZipFile a little, fix a few bugs, and improve the documentation.

The main bug fixed is fixing support for .zip files larger than 2GiB (where
the central directory offset's top bit is set).

We were checking character counts rather than byte counts in several places
too, which could lead to corrupt zip files.

I've also added a comment to readCentralDirectory because I keep coming back
to this code, wanting to make it lazy, and never remember (until I've done
half the work) why that's not possible.

I've also clarified a lot of the documentation.

Bug: http://code.google.com/p/android/issues/detail?id=36187
Change-Id: Iaa8eadc501ead7c70528bd9063d5893a325dcea1
ipFileTest.java
02e0e9bce2706f0024e6f51275e2834dfacdb570 26-Jul-2012 Elliott Hughes <enh@google.com> Make ZipFileTest#testHugeZipFile faster, and reduce ZipFile memory usage.

This test was timing out because of unbuffered I/O.

ZipFile was creating an unnecessary byte[] when writing out the central
directory. In the case of these tests, that was an extra 3MiB of heap!

(cherry-picked from a57c521b9d250f909508af771b96c0011676a968.)

Bug: 6481730
Change-Id: I923e563421056c9c0e73246357ccf54d8fb60cdb
ipFileTest.java
a57c521b9d250f909508af771b96c0011676a968 26-Jul-2012 Elliott Hughes <enh@google.com> Make ZipFileTest#testHugeZipFile faster, and reduce ZipFile memory usage.

This test was timing out because of unbuffered I/O.

ZipFile was creating an unnecessary byte[] when writing out the central
directory. In the case of these tests, that was an extra 3MiB of heap!

Bug: 6481730
Change-Id: I75acac35c556ad5fdc8b06bc616c11244d6b6c55
ipFileTest.java
5e60f2b0a2d9bb5a069fbe5e898fff8520936977 24-Jun-2012 Brian Muramatsu <btmura@google.com> Fix OldAndroidZipStressTest for user builds

The test was trying to create ZipFile instances with ODEX files and
failing so add a FileNameFilter that only returns APK files.

Bug 6721995

Change-Id: Ifadcb993d37f7f08e4864c5ce5e8dc4ed7d439fb
ldAndroidZipStressTest.java
9f050bd1d16b822532430c897991e27a58605ff5 11-Jan-2012 Elliott Hughes <enh@google.com> Fix an ICS regression with zip files containing >= 32768 entries.

The usual signed/unsigned 16-bit field problem with zip files. In adding a unit
test I also found two other long-standing bugs:

1. We had O(N^2) behavior when adding files. Someone used an List where they
wanted a Set. Fixed by switching that code over to a Set.

2. We were allowing people to create .zip files with > 64Ki entries but
generating a file that would claim to have (entryCount & 0xffff) entries.
Fixed to throw ZipException until we have proper Zip64 support.

Bug: http://code.google.com/p/android/issues/detail?id=23207
Change-Id: Ice9c9790782639ba50e1ca057bc2cf21a945e147
ipFileTest.java
0647bfed6eda99ad77b2dfe8e3696e3fabfaf3cc 13-Dec-2011 Jesse Wilson <jessewilson@google.com> Bring more tests from frameworks/base/tests/CoreTests into libcore.

Bug: http://b/3073226
Change-Id: I66f88f2bfaadd39e53b2977606731e8579d880b6
ldAndroidZipStressTest.java
8601d6b5872167f20f3ab845160ae7f9e0fad94b 16-Mar-2011 Brian Carlstrom <bdc@google.com> Deflater doc and test tidying

Change-Id: If140c104d5736e41669a20af5606a54ce338d60c
eflaterOutputStreamTest.java
89267eeebbfe246d75921aec68a0cd84f2391b82 16-Mar-2011 Brian Carlstrom <bdc@google.com> am 13218d63: am 6deb2478: am a321720e: Test for SYNC_FLUSH Deflater

* commit '13218d6395389341b85e0d7e19c1c1511e9367be':
Test for SYNC_FLUSH Deflater
a321720e459ae0d7fc403d112f2e974102a59d9f 16-Mar-2011 Brian Carlstrom <bdc@google.com> Test for SYNC_FLUSH Deflater

Bug: 4005091
Change-Id: I1cbd95ed4d87966e18a601501d6db6cbb277f25c
eflaterOutputStreamTest.java
229e34b182b98e1dba15d3dc6341954986ae2b7a 03-Mar-2011 Brian Carlstrom <bdc@google.com> Removing use of @tests and @Test.* annotations

Change-Id: I89243efdeebe22543c45a2166b634f40c3e78cf8
ldZipFileTest.java
b9f4eb77cf7c5937fcd33d839c749900112874bd 07-Jan-2011 Jesse Wilson <jessewilson@google.com> Don't short-circuit Inflater.inflate() on zero-length requests.

Change-Id: I2d207ee16dd432ba4211990da21a345f81375039
http://code.google.com/p/android/issues/detail?id=11755
nflaterTest.java
990640f1775dc6f429a5f8b9fc6cab6b4220c03a 15-Dec-2010 Jesse Wilson <jessewilson@google.com> Move 41 tests to libcore, closer to the tested code.

Change-Id: I0ecaacd0e68b8319806555f71ddf347f01b17be9
http://b/3073226
ldAndroidChecksumTest.java
ldAndroidDeflateTest.java
ldAndroidGZIPStreamTest.java
ldAndroidZipFileTest.java
ldAndroidZipStreamTest.java
aee3e4d2e0a2830fc2ef8e96a13796d012becab2 07-Dec-2010 Elliott Hughes <enh@google.com> Throw better exceptions if an Inflater or Deflater is used after calling end.

Bug: 3217912
Change-Id: I480c92d2f97b530f17b9b8daf2549d2f06384219
nflaterTest.java
2d9c5fa8ce0182cd8c14736241b709fd50cab6f8 23-Nov-2010 Elliott Hughes <enh@google.com> Slight cleanup of java.util.zip code, plus a bug fix.

The key fix is switching to zstream's next_in and next_out fields (the
pointers into the input and output buffers) rather than relying on the
integer "accounting" fields. If turns out in the Z_NEED_DICT case that
the accounting goes slightly awry. (We shouldn't have been using the
accounting anyway, because we were silently coercing longs to ints.)
The new code is simpler, clearer, and doesn't need a special case for
Z_NEED_DICT at all.

I've also removed yet another hand-written UTF-8 encoder, made Inflater
throw ArrayIndexOutOfBoundsExceptions with useful detail messages (factored
out into Arrays so we can make this change more widely), and
rewritten the Inflater and Deflater documentation.

The unit test reproduces the problem (and tests as many other cases as
it can too). Critical for testing this bug is that we needed to limit
the size of the input buffer so that zlib has to ask us for more input.

Bug: 3220923
Change-Id: I39e5456620eaa7f75d12d885db279f009ee3e8ef
eflaterOutputStreamTest.java
nflaterTest.java
27495197b6f411df17116022bd0f5458aecd9c84 12-Nov-2010 Elliott Hughes <enh@google.com> A specific test for http://b/3181430.

Bug: 3181430
Change-Id: If1e02a888863143f4c56d1ef57e265d7c7bffcc4
ipOutputStreamTest.java
55e276b6718282224e0069645da2222beda7b8df 11-Nov-2010 Elliott Hughes <enh@google.com> Tests that would have caught my recent ZipInputStream/ZipOutputStream regressions.

Not the best tests in the world, but they would have been sufficient.

Bug: 3181430
Change-Id: Id68f5bb6a2c66f9f5c8c061b34dfeb5d3d63e63e
ipInputStreamTest.java
ipOutputStreamTest.java
0c7d369eb9cae44596f73cf2f044d59397abab8d 04-Nov-2010 Elliott Hughes <enh@google.com> GZIPInputStream/GZIPOutputStream test improvements.

1. Ensure that there's a direct mapping from the class to its test,
so we're more likely to run the right tests. I've broken GzipTest
into two for this.

2. Include actual data rather than always round-tripping, to avoid
potential symmetric errors. (This wasn't important in this case.)

3. Remove a dead file that belonged to a test that's already been
removed.

Bug: 3164285
Change-Id: I312237454eead26d0dbbdb8f6339aa29ed8eea4e
ZIPInputStreamTest.java
ZIPOutputStreamTest.java
zipTest.java
5d060f399d673f7e4d57c426fc7d87e707c31d5c 01-Oct-2010 Jesse Wilson <jessewilson@google.com> am 5df67087: am ff805724: am 16bba11e: Merge "Don\'t use the decompression-buffer as the skip buffer in InflaterInputStream." into gingerbread

Merge commit '5df6708702ddd1405e7d0a39e9f806cefd330028' into dalvik-dev

* commit '5df6708702ddd1405e7d0a39e9f806cefd330028':
Don't use the decompression-buffer as the skip buffer in InflaterInputStream.
5df6708702ddd1405e7d0a39e9f806cefd330028 01-Oct-2010 Jesse Wilson <jessewilson@google.com> am ff805724: am 16bba11e: Merge "Don\'t use the decompression-buffer as the skip buffer in InflaterInputStream." into gingerbread

Merge commit 'ff8057246a6d43a55c93c9c728a6dddb0d98fcdb'

* commit 'ff8057246a6d43a55c93c9c728a6dddb0d98fcdb':
Don't use the decompression-buffer as the skip buffer in InflaterInputStream.
3541c79d5058b86e742867b4ee5811a1de01de1f 30-Sep-2010 Jesse Wilson <jessewilson@google.com> Don't use the decompression-buffer as the skip buffer in InflaterInputStream.

This has bad consequences for the GzipInputStream subclass, which can't
use the input buffer as a scratch space because it needs to CRC all of
the decompressed data.

Change-Id: I310261dc8ef7a5082768cc6d6a2eff4ef77f5a21
http://b/3042574
zipTest.java
b18d7a024d28fcce3497e2cd8d78642b5d057d45 26-Sep-2010 Jesse Wilson <jessewilson@google.com> Remove zip and jar tests duplicated from Harmony.

Change-Id: I06b18c2197482dbf5b52c72ffa19c87eca16e201
ldDataFormatExceptionTest.java
ldZipExceptionTest.java
ldZipFileTest.java
ldZipInputStreamTest.java
ipFileTest.java
b814b1850f5ed997ea1e7f574c8fc0df6a693c36 09-Sep-2010 Jesse Wilson <jessewilson@google.com> Address test failures in java.util.zip.

Some deflater tests fail because they expect a specific byte sequence in
the compressed form. Our compressed form is valid but has a different
sequence. I've written new tests to cover the related APIs and suppressed
the broken tests.

The other deleted tests are duplicated exactly from Harmony. I'm removing
our copy.

Change-Id: If480d54948e634e4f6b1018da30951a1d4d07b49
eflaterInputStreamTest.java
eflaterTest.java
355a98498e4bc434dde8809eacf6e150f9b25f89 02-Sep-2010 Jesse Wilson <jessewilson@google.com> Fix a findbugs bug where ZipEntry.clone() didn't call super.clone().

See http://b/2099615

Change-Id: Ib1347aa5e35c62501d9d59eccfdfed098559d552
ipEntryTest.java
4557728efb66c455a52b7669a8eefef7a9e54854 11-Aug-2010 Jesse Wilson <jessewilson@google.com> Moving tests to be under the libcore.* package.

This is indended to make it easier to run on VMs that restrict the packages
from which application classes can be loaded. For example, on the RI you need
to use the bootclasspath to load these tests.

Change-Id: I52193f35c5fcca18b5a3e1d280505b1e29b388af
eflaterOutputStreamTest.java
eflaterTest.java
ipEntryTest.java
ipFileTest.java