diff options
author | Tobias Thierer <tobiast@google.com> | 2016-09-06 13:58:49 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2016-09-06 19:51:24 +0100 |
commit | d4b7449574ca69c713a3f2230cb77c68ee642700 (patch) | |
tree | eeecd9e20dc6eeab75563a86f41efa9253eb735c /annotations/generate_annotated_java_files.py | |
parent | a0228e4cc9d8a3dc48df26b025f4376b7c0cab1b (diff) |
Fix 58 libcore tests that caught "expected" Exceptions but didn't fail()
There were no changes to code under test.
4 tests were fixed to not tolerate an Exception:
- libcore.java.util.CollectionsTest#test_CheckedMap_computeIfAbsent
In the case where a Map key is present, computeIfAbsent() should
not invoke the Function, so there is no return value that could
be expected to undergo a type check. The test was changed to
verify that the Function is not invoked.
- libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_sort and
libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_subList_sort
were sorting an already-sorted non-null list that contains no null
values. That logic was redundant and wouldn't have thrown.
- org.apache.harmony.security.tests.java.security.KeyStoreSpiTest#test_engineEntryInstanceOf
(the KeyStoreSpi documentation does not mention whether NPE is thrown;
the implementation comes from upstream and does not throw it).
54 tests were fixed by adding the missing
fail();
No attempt was made to make this failure message specific to the
exception that was expected.
Tests that weren't changed:
- SSLEngineTest.test_wrap_ByteBuffer_ByteBuffer_04() requires
investigation to determine the correct resolution.
A comment was added to the test linking to the corresponding bug.
- ThreadTest#testParkUntilWithUnderflowValue() and
OldNodeChangeEventTest.waitForEvent() were not touched since
it was not clear whether that it was relevent to the test whether
or not the exception was thrown.
- two cases in Files2Test#test_setPosixFilePermissions_NPE() are
left to a future CL
Test:
(croot; make vogar core-tests) \
&& git diff aosp/master --name-only | xargs vogar `cparg core-tests`
Change-Id: I1cd3220a06e331ff049b146b393f78879f07211a
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions