summaryrefslogtreecommitdiffstats
path: root/harmony-tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a brain dead mistake in DeflaterInputStreamTest.Narayan Kamath2013-12-191-2/+2
| | | | | | Removal of debug code gone bad. Change-Id: I93d9decbd9d733cbeccd7832fef6857cf1b41b25
* Make DeflaterInputStream#available more consistent.Narayan Kamath2013-12-191-30/+70
| | | | | | | | | | | | | | | | | | | - We now guarantee that available() returns 0 iff. deflater.finished() == true. Note that this is still inconsistent with the specification of InputStream#available. - Remove an unnecessary array copy in DeflaterInputStream#read. - Remove tests that expect an IllegalArgumentException for negative skip count values. The InputStream spec doesn't mandate that we must throw here, and it's better to be consistent with every othem InputStream specialization in the code. - Remove obsolete failures from brokentests.txt. bug: 12189307 Change-Id: Ie9b1ad5d7c050b005b5f6f44a5a283bfdaeb1e81
* Throw an NPE in a more obvious manner.Narayan Kamath2013-12-181-24/+0
| | | | | | | Also remove tests with broken expectations that were never implemented. Change-Id: I5eb60d3e6dfb8ead6e23941fca1bc19f79c4a158
* Move tests from harmony/archive to libcore.Narayan Kamath2013-12-1831-0/+9194
| | | | | | | Also moves a couple of tests from luni/src/test to harmony-tests/ where they belong. Change-Id: I0b441b1fcbd355bd3c66551d16732a671fb64f54
* Address review comment for OutputStreamWriterTest.Narayan Kamath2013-12-121-1/+1
| | | | | | A comment was missing the word "the". Change-Id: I592c998774e7335881f03006c9e28700b048b8db
* Address review comments.Narayan Kamath2013-12-121-65/+66
| | | | | | | Automatic IntelliJ reformatting of a weirdly formatted test. Change-Id: I9ce29d9004dfe625a8479a77230248db3d1b9e3b
* Fix a CharsetEncoder bug.Narayan Kamath2013-12-121-11/+16
| | | | | | | | | | | | | | | | | | When malformed or unmappable characters span input buffers, we'd end up setting a negative position on the buffer. Also fix up a few test cases which were wrong in several ways. - One test was simply checking for the wrong sort of exception (unmappable vs malformed) - Another test was expecting encode() to throw an error (and ignoring flush) but the API allows flush to throw an error instead of encode. bug: 10729779 Change-Id: I6560b749ca2445651d61ca651f8a5e388cf1c1b0
* Fix several issues in CookieManagerTestNarayan Kamath2013-12-111-9/+15
| | | | | | | | | | | | | | | | | | | | - Fix a mistaken assumption about how path matching works. - Change a TreeMap to a LinkedHashMap, because TreeMaps are not required to support null keys. - Change a bogus "equals" check for the version to a startsWith check. - Change various tests re: the size of the output list. The specification doesn't require us to create separate Cookie headers for each cookie found in the store. It is free to concatenate the contents of matching cookies. - Change tests that expected the addition of an empty list to the headers map when there are no matching cookies. The spec does not require this. bug: 11689102 Change-Id: I341c301f18e410b983d010b5d2f14b3462901bf5
* Fix PasswordCallback serialization test.Narayan Kamath2013-12-021-4/+17
| | | | | | | The object doesn't override equals & hashCode so it needs a serialization comparator. Change-Id: Ie6067ad1e6cd22f5e2b83907e5bf2ea0039466cb
* Fix an OutputStreamWriterTest test case.Narayan Kamath2013-11-271-4/+4
| | | | | | | | | Check for the nio canonical name instead of the "old" canonical name. bug: 11665359 Change-Id: Icc813a77cfb7d61ddb0ce33fbdf48ccbe0ded7fb
* Delete a few bad test cases from CharsetEncoderTest.Narayan Kamath2013-11-271-10/+0
| | | | | | | | | These tests were added in commit 5ec6bf8d0 and were assumed to have been caused by an ICU bug. They were in fact caused by bugs in our ICU glue code and those issues have now been fixed. Change-Id: Ia21a5b466eea685f175fa370d9e2b3b3342cd1b8
* Merge "Fix a testcase in InputStreamReaderTest."Narayan Kamath2013-11-271-8/+4
|\
| * Fix a testcase in InputStreamReaderTest.Narayan Kamath2013-11-261-11/+5
| | | | | | | | | | | | | | | | Fix path to test resource. bug: 11665359 Change-Id: Id360215499bc20620c096a3f0a4e85970e606c2b
* | Fix several decoder bugs.Narayan Kamath2013-11-261-9/+6
|/ | | | | | | | | | | | | | - NativeConverter should report unterminated character sequences to managed code. - CharsetDecoderIcu should report those errors correctly from flush() - InputStreamReader should check the return value of flush() and not ignore it altogether. bug: 11665359 bug: 10729779 Change-Id: Ic678a645a4ef2b3fe70e2c900c0cd393679f1037
* Merge "Import missing harmony tests for javax.security.auth."Narayan Kamath2013-11-2623-289/+3242
|\
| * Import missing harmony tests for javax.security.auth.Narayan Kamath2013-11-2523-289/+3242
| | | | | | | | | | | | | | | | | | | | Mostly missing serialization tests. Also - Fix up package names for tests. - Move tests under the right subpackage where applicable. Change-Id: If30995f5b62a1dcc9f0150d2c16e29bb1b65a48c
* | am 0af9d85d: am 2e8bdf33: Merge "Make PipedWriter#flush throw if the reader ↵Narayan Kamath2013-11-211-9/+6
|\ \ | |/ | | | | | | | | | | is closed." * commit '0af9d85d7071ca74b12418595b8c42533007fad5': Make PipedWriter#flush throw if the reader is closed.
| * Make PipedWriter#flush throw if the reader is closed.Narayan Kamath2013-11-201-9/+6
| | | | | | | | | | bug: 11666814 Change-Id: I25dc56f5e50e0cfb14e5781e953115864be612a9
* | am 7420e424: am 68cf52ad: Merge "Clean up & fix PipedInputStreamTest."Narayan Kamath2013-11-211-62/+40
|\ \ | |/ | | | | | | * commit '7420e4247b897a723c6a04c05e70eebcd556af8d': Clean up & fix PipedInputStreamTest.
| * Clean up & fix PipedInputStreamTest.Narayan Kamath2013-11-201-62/+40
| | | | | | | | | | | | | | Add additional documentation where necessary. bug: 11666814 Change-Id: I622d180c89f835e9466c7efe8f6a079c2516b73f
* | am d121f03c: am a79889ac: Merge "Remove bogus test case in TreeSetTest."Narayan Kamath2013-11-211-8/+0
|\ \ | |/ | | | | | | * commit 'd121f03c3de5a260444740a185c0afb71e5fb423': Remove bogus test case in TreeSetTest.
| * Merge "Remove bogus test case in TreeSetTest."Narayan Kamath2013-11-181-8/+0
| |\
| | * Remove bogus test case in TreeSetTest.Narayan Kamath2013-11-181-8/+0
| | | | | | | | | | | | | | | | | | | | | Adding a non-comparable key to the set will throw an exception. Change-Id: Ie3474f657c45891671b8fd1e10cea5a75c9179dc
* | | am 93a3a9cc: am a95d8947: Merge "Fix typos in comments."Narayan Kamath2013-11-211-2/+2
|\ \ \ | |/ / | | | | | | | | | * commit '93a3a9ccc64094da3771bfa4795967639ef34307': Fix typos in comments.
| * | Fix typos in comments.Narayan Kamath2013-11-181-2/+2
| |/ | | | | | | | | | | | | | | Addresses review comments from : https://android-review.googlesource.com/#/c/70041 Change-Id: Idcb799a24f3ea63fa0fc6702f7c7c55f3a1a9b48
* | am cfeab7b3: am 47f7ed46: Merge "Move tests from tests/api to harmony-tests. ↵Narayan Kamath2013-11-15475-4/+156350
|\ \ | |/ | | | | | | | | | | (Take 2)" * commit 'cfeab7b3523347cdfa1ce1f7fffc922f2cc0ab65': Move tests from tests/api to harmony-tests. (Take 2)
| * Move tests from tests/api to harmony-tests. (Take 2)Narayan Kamath2013-11-15475-4/+156579
|/ | | | | | | This reverts commit d5e281743e55e1daa297fd8043b2d9b6e8e1bed2. The makefile issue that caused the original build break has been resolved.
* Revert "Move tests from tests/api to harmony-tests."Narayan Kamath2013-11-15475-156579/+4
| | | | | | | | This reverts commit 81bf28ad31131815d0a36a43a0eca3c29aefdfcd. Breaks build Change-Id: I3f1562921ffe8fdbec36971dd65db398c27c92db
* Move tests from tests/api to harmony-tests.Narayan Kamath2013-11-15475-4/+156579
| | | | | | | The vast majority of cleaned up harmony tests are now in harmony-tests/src/test/org/apache/harmony/tests/ Change-Id: I56c2e484ff434b5618cf6751d602ae9f0db96b30
* Use a consistent package path for harmony tests.Narayan Kamath2013-11-15174-144/+146
| | | | | | | | | | | | | | | | | | | | | Harmony was never consistent about where they put their tests. There's no reason we have to be the same. Also, there's no need to have separate subtrees for nio, nio_char etc. etc. This change makes all existing apache harmony tests subpackages of "org.apache.harmony.tests" and put them under libcore/harmony-tests. We somehow managed to end up with two vastly different copies of CharsetDecoderTest & CharsetEncoderTest. I've renamed the copies CharsetDecoder2Test & CharsetEncoder2Test to avoid having to go in and resolve the complicated diffs or speculate about the reasons for their divergence. Change-Id: Ic34e69c2faab8893edd54e05eccd7091f4a09abd
* Merge "Import resources, fix JarURLConnectionTest."Narayan Kamath2013-11-152-0/+0
|\
| * Import resources, fix JarURLConnectionTest.Narayan Kamath2013-11-142-0/+0
| | | | | | | | | | | | The test case with the escaped URL still fails. Change-Id: Iae3a58fea800d8b981cb09474d1fa77b7c361e4e
* | Merge "Fix numerous harmony test failures"Narayan Kamath2013-11-151-0/+3
|\ \
| * | Fix numerous harmony test failuresNarayan Kamath2013-11-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ProcessBuilderTest : Don't execute java -version on the device. String2Test: Don't make assumptions about the order of the BOM. ThreadTest: We don't support Thread#destroy ControlTest : Fix bogus URL, this test still needs some work IdentityHashMap2Test : Fix bogus asserts. Also don't make assumptions about the implementations of Integer#tostring. The test was failing because Integer cached string reps of "small" integers. SimpleEntryTest / SimpleImmutableEntryTest : Don't rely on broken harmony TreeMap behaviour that allowed null keys. TimeZoneTest: Add vogar specific workaround & update display names. Change-Id: Ie3204917e1d729b0f4ac3bdcbf61fc6a54ab9387
* | | Merge "Import resource and fix ClassTest."Narayan Kamath2013-11-151-0/+1
|\ \ \
| * | | Import resource and fix ClassTest.Narayan Kamath2013-11-131-0/+1
| | |/ | |/| | | | | | | | | | | | | (Still fails on resources that have a # though) Change-Id: I41b2657a57dd06ea1fd61de157ff4e8ea8bba7ac
* | | Merge "Fix a few failures in FileURLConnectionTest."Narayan Kamath2013-11-155-0/+104
|\ \ \ | |_|/ |/| |
| * | Fix a few failures in FileURLConnectionTest.Narayan Kamath2013-11-145-0/+104
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Some tests still fail, but they appear to be valid tests. There are at least two separate issues here : - ClassLoader#getResource seems to be constructing a bogus URL (at least in this context). findResource returns a non null URL, but URL#openStream throws. - URLs with fragments (#foo) don't appear to work correctly. Change-Id: Iabf03e49c56659039feb85a0e528efcaaed0b49d
* | Add serialization golden files, fix tests.Narayan Kamath2013-11-1360-0/+1
|/ | | | | | | | | - Moves a few golden files from luni/ to harmony-tests/ - Delete dead code in SerializationTester - Fix a bug in SerializationTest (not sure how this ever worked for resources with "." in their name) Change-Id: Ia5b1376f4ada9b9c706a266ae077debeea5b1f29
* Fix a varargs warning in MessageFormatTest.Elliott Hughes2013-10-151-2/+2
| | | | | | bdc was right. Change-Id: I89c470d5deb4abcd0f3ecaeeac29da377e70eafb
* Clean up CharsetDecoder and CharsetEncoder.Elliott Hughes2013-09-136-112/+131
| | | | | | | This patch also fixes a few bugs, and a few test bugs, and then the bugs exposed by fixing those tests. Change-Id: Id52f8d9d8c812847ed7af36e8f8721c933f819c1
* Fix a bug in DateFormat, clean up some SimpleDateFormat tests.Elliott Hughes2013-09-091-190/+221
| | | | | | | | | | | | | | | | | | | | | | We failed a couple of tests because of an assumption about the default time zone: junit.framework.AssertionFailedError: Wrong format: " d" expected: 12 result: 11 at java.text.SimpleDateFormatTest.test(SimpleDateFormatTest.java:55) at org.apache.harmony.tests.java.text.SimpleDateFormatTest.test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition(SimpleDateFormatTest.java:347) junit.framework.AssertionFailedError: Wrong result: h input: 12 expected: Thu Jan 01 00:00:00 UTC 1970 result: Thu Jan 01 08:00:00 UTC 1970 at java.text.SimpleDateFormatTest.parse(SimpleDateFormatTest.java:86) at org.apache.harmony.tests.java.text.SimpleDateFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition(SimpleDateFormatTest.java:546) Cleaning up the tests and merging OldSimpleDateFormatTest into SimpleDateFormatTest accidentally made one of our tests more strict, at which point it failed because we weren't updating the FieldPosition for 'z' or 'Z' when formatting or parsing. So this patch fixes that by mapping the DateFormat.Field to the appropriate int for Calendar. Change-Id: If4b2f2c02d8ccd50d96d77df3b60e1c1d65ae666
* Clean up useless comments in MatcherTest.Elliott Hughes2013-09-091-69/+16
| | | | Change-Id: I921a8e1edb1d2aa596325cf03c04196328b3930b
* More java.text test cleanup/fixes.Elliott Hughes2013-09-042-38/+460
| | | | | | | | | I investigated http://bugs.icu-project.org/trac/ticket/10353 further and decided it's WAI, so we can remove a TODO implying that icu4c was incorrect. Also merge the remaining OldDecimalFormatTest tests, removing duplication. Change-Id: I1941dd1bef3b5eae258960ca8a5fcd2e7de0c926
* Only use public API for icu4c's FieldPositionIterator.Elliott Hughes2013-09-041-77/+0
| | | | Change-Id: I247f7c644537b8e9f67f4f27360ce1449fa04300
* Fix a DecimalFormat crash when formatting the empty string.Elliott Hughes2013-08-301-0/+9
| | | | | | | | | | We don't even need a general-purpose iterator, and it's never exposed to user code, so we can simplify things quite a bit. The key change though is that a null array is not an error condition --- it just means we didn't actually output anything. Bug: https://code.google.com/p/android/issues/detail?id=59600 Change-Id: I7ec0bab00e15ab5c3a4dbd15e2dc81494f68e82f
* Fix harmony java.text test failures.Elliott Hughes2013-08-3014-2058/+1908
| | | | | | | | | | | | | | | | | | | | | | | | | | | There were plenty of bad tests here, but there were some real bugs too. * DecimalFormat was only handling RoundingMode.UNNECESSARY for double formatting. * DecimalFormat was not ensuring that it's superclass' fields were being correctly updated. * NumberFormat was throwing NPE for a null object because of an improved detail message, despite being specified to throw IAE. * We weren't mapping NumberFormat.Field instances to the corresponding icu4c UNUM_x_FIELD constant, so we weren't actually setting FieldPosition objects correctly. * SimpleDateFormat was not formatting milliseconds correctly with 'S'. * NativeDecimalFormat wasn't handling JNI NewString OOME correctly. Bug: 2528220 Bug: 3056865 Bug: 3057080 Bug: 3057090 Change-Id: Iac11f902f2e9649e596e7e7b7bc501b13e956fca
* Add harmony java.text tests.Elliott Hughes2013-08-2731-0/+11201
| | | | Change-Id: Id8d0acd77d08ff337b4851ae74a48cc002d66cd9
* Remove bogus @test comments that confuse vogar.Elliott Hughes2013-08-231-9/+0
| | | | | | | They should be @tests, but they're useless anyway. (If there weren't so many, I'd remove all the @tests comments too.) Change-Id: I6d34a77c48d7d0bac075758453fd0d29f6f9901c
* Fix java.util.Scanner bugs.Elliott Hughes2013-08-201-1074/+967
| | | | | | | | Also improve the documentation for java.util.regex.Matcher and unify the Scanner tests. Bug: 10310707 Bug: https://code.google.com/p/android/issues/detail?id=40555 Change-Id: I97bd8243845aaa31c084c8424eceb41bbcd8ebbd