508f0abe4f8686d29466b2c364cb4f60bf0484b5 |
|
16-Jan-2017 |
Tobias Thierer <tobiast@google.com> |
Basic tests for wrapper Collection factories in java.util.Collections Basic test coverage for the wrapper Collections constructed by the following static factory methods in java.util.Collections: checkedNavigableMap() checkedNavigableSet() checkedQueue() emptyNavigableMap() emptyNavigableSet() emptySortedMap() emptySortedSet() synchronizedNavigableMap() synchronizedNavigableSet() unmodifiableNavigableMap() unmodifiableNavigableSet() These 11 methods under test are the only ones currently annotated @hide in Collections.java; this CL provides sufficient test coverage for those to be un-hidden in a follow-up CL. Most (perhaps all) aspects covered by these tests are also covered by guava-testlib-21.0 tests, but those are not yet available in AOSP and would take 80min to run, whereas these new tests only take a few seconds to run. SpliteratorTester previously contained some overly strict assertions that Spliterator.trySplit() != null. This CL relaxes this assumption for non-empty spliterables but adds a separate assertSupportsTrySplit() check in the places that previously exercised this strict test logic; Where the old tests appeared to be testing the wrong collection (e.g. in HashSetTest), this CL asserts the support for trySplit on what appears to be the correct Collection, but does not otherwise fix the existing test code. Bug: 29935305 Test: CtsLibcoreTestCases Change-Id: Ibeac242bb60df7b06a1c8c80dc744707f734d91c
|
40938aa75c0a78043ead765b5679e4413cb23edf |
|
24-Nov-2016 |
Tobias Thierer <tobiast@google.com> |
Increase timeout for flaky WeakHashMap.test_keySet() This CTS test has been flaky since at least Nov 2015 because weak references were not always cleared within the 5sec that the test claims as an upper bound for the time until "the ReferenceQueue daemon will enqueue the cleared rereferences". It looks like Daemons.MAX_FINALIZE_NANOS is likely the value the test is talking about, but that value is 10 seconds. Further, there are some possible races such as WeakHashMapTest evaluating entrySet.size() before checking elapsed time. Therefore, this CL increases the amount of time the test waits at most to 10.5 seconds (Daemons.MAX_FINALIZE_NANOS plus 500msec margin). Bug: 25437292 Test: WeakHashMapTest Change-Id: I99dc76106e7a95da99f04db3bc1ed1ed6f738d97
|
8b056f0b15bc1e45da8d4c504353b05e681ac013 |
|
04-Mar-2016 |
Narayan Kamath <narayan@google.com> |
Add java.lang.Iterable.spliterator() and supporting classes. The only android specific changes here are to HashMap - their spliterators add Spliterator.ORDERED if the HashMap is an instance of a LinkedHashMap. There's some degree of duplication between the test code used to exercise primitive arrays (Arrays / Spliterators provide similar APIs). These differences are quite hard to consolidate, since the Arrays version declares that their Spliterators are ORDERED but the Spliterator version doesn't. The latter also allows us to declare additional Spliterator characteristics. bug: 27426688 Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
|
a73ca5822d77cff8b675ead6e5a3ad190183ba1c |
|
04-Mar-2016 |
Narayan Kamath <narayan@google.com> |
Add java.lang.Iterable.spliterator() and supporting classes (part 2). A git snafu meant that the delta between PS9 and PS10 of the aosp commit this was cherry-picked from did not make it to nyc-dev. This change commits that delta. bug: 27426688 Change-Id: I18e9f8ea397ab5463a5ff671167feaa20512afa5
|
4c89023ef86f29fa9add7db2574f2169fe842577 |
|
04-Mar-2016 |
Narayan Kamath <narayan@google.com> |
Add java.lang.Iterable.spliterator() and supporting classes. The only android specific changes here are to HashMap - their spliterators add Spliterator.ORDERED if the HashMap is an instance of a LinkedHashMap. There's some degree of duplication between the test code used to exercise primitive arrays (Arrays / Spliterators provide similar APIs). These differences are quite hard to consolidate, since the Arrays version declares that their Spliterators are ORDERED but the Spliterator version doesn't. The latter also allows us to declare additional Spliterator characteristics. (cherry-picked from commit ed21aa3a8dcd34eca6f0317eeb683e7afdc825b9) bug: 27426688 Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
|
60796efea3a74e02aea384b8eb56103ea21b880b |
|
29-Feb-2016 |
Przemyslaw Szczepaniak <pszczepaniak@google.com> |
Add Iterable#forEach & Map#forEach from openJdk8 Based on openJdk 8u40 source & iam@ stream change in ag/872080 Bug: 27404545 Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e (cherry picked from commit c3a9db83a352d92d5a6e0098f22bde07e34a1d3b)
|
c3a9db83a352d92d5a6e0098f22bde07e34a1d3b |
|
29-Feb-2016 |
Przemyslaw Szczepaniak <pszczepaniak@google.com> |
Add Iterable#forEach & Map#forEach from openJdk8 Based on openJdk 8u40 source & iam@ stream change in ag/872080 Bug: 27404545 Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e
|
1ccc81206769598b4ce579dd0c4f131bf37bb1c3 |
|
09-Nov-2015 |
Roland Levillain <rpl@google.com> |
Fix more race conditions in WeakHashMapTest. Reuse Mathieu's solution from https://android-review.googlesource.com/#/c/99045/. Also, re-wrap some assertion lines. Bug: 25437292 Change-Id: I7ec5101d6169d978ee8c3782e2f985aa1f0a6d5d
|
97afbd7972a43345ea12eb442b2a4e473b03d881 |
|
23-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix race condition in WeakHashMapTest. There was a race condition where the reference queue daemon wouldn't necessarily have processed the cleared references by the time we called WeakHashMap.size(). The race is fixed by doing a busy wait with a 5 second timeout. This should't increase the test time in the average case since the cleared weak references should be processed shortly after induceFinalization finishes. Bug: 15775475 Change-Id: I66350b6c87252e98bfbd945fe1f96bef58ec24a9
|
ab762bb740405d0fefcccf4a0899a234f995be13 |
|
15-Nov-2013 |
Narayan Kamath <narayan@google.com> |
Move tests from tests/api to harmony-tests. (Take 2) This reverts commit d5e281743e55e1daa297fd8043b2d9b6e8e1bed2. The makefile issue that caused the original build break has been resolved.
|
d5e281743e55e1daa297fd8043b2d9b6e8e1bed2 |
|
15-Nov-2013 |
Narayan Kamath <narayan@google.com> |
Revert "Move tests from tests/api to harmony-tests." This reverts commit 81bf28ad31131815d0a36a43a0eca3c29aefdfcd. Breaks build Change-Id: I3f1562921ffe8fdbec36971dd65db398c27c92db
|
81bf28ad31131815d0a36a43a0eca3c29aefdfcd |
|
15-Nov-2013 |
Narayan Kamath <narayan@google.com> |
Move tests from tests/api to harmony-tests. The vast majority of cleaned up harmony tests are now in harmony-tests/src/test/org/apache/harmony/tests/ Change-Id: I56c2e484ff434b5618cf6751d602ae9f0db96b30
|