summaryrefslogtreecommitdiff
path: root/jsr166-tests/src
Commit message (Collapse)AuthorAgeFilesLines
* Inclusive Language Fixit: step #4Paul Duffin2020-07-281-2/+2
| | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Bug: 162205877 Test: m java Change-Id: Ia8f7cb6b2a569e347962584d820b9179c19e1b99
* libcore: Add a libcore-patch-style scriptOrion Hodson2020-03-101-3/+3
| | | | | | | | | | | | Checks style against recommendations in http://go/libcore-patch-style and could be used a repohook. Update sources based on issues found with script. Bug: 111597837 Test: cd tools/patch-style/ && awk -f libcore-patch-style.awk test-input.txt Test: find . -type f | xargs awk -f tools/patch-style/libcore-patch-style.awk Change-Id: I641ed2951d00b848dec7a713e08b4b9fc076baea
* Restore the visibility checks in Atomic.*FieldUpdater.Pete Gillin2018-03-203-188/+177
| | | | | | | | | | | | | This change is just reverting unintended diffs against upstream sources. (The call to checkPackageAccess is a noop on Android because it only does SecurityManager checks, so this change leaves that suppresses as it is right now. The call to ensureMemberAccess does regular visibility checks, and is restored in this change.) Bug: 75269521 Test: cts-tradefed run cts-dev -m CtsLibcoreJsr166TestCases Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases Change-Id: I5e050f786709fb28543ca4ea409eb9876539fc6f
* Automated: Canonicalize spelling of Android-changed across libcoreTobias Thierer2017-03-063-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies the same regexp replacement across libcore that http://r.android.com/345826 had only applied to ojluni. Most of the previous noncanonical spellings were a lowercased "android-" that should be "Android-". This CL was created by running the following command on top of the above CL. No manual changes were made. find . -name \*\.java | xargs sed -i \ -e 's/Android[- ]changed/Android-changed/ig' \ -e 's/Android-changed :/Android-changed:/g' \ -e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \ -e 's/Android-changed - /Android-changed: /g' \ -e 's/Android[- ]removed/Android-removed/ig' \ -e 's/Android-removed :/Android-removed:/g' \ -e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \ -e 's/Android-removed - /Android-removed: /g' \ -e 's/Android[- ]added/Android-added/ig' \ -e 's/Android-added :/Android-added:/g' \ -e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \ -e 's/Android-added - /Android-added: /g' \ -e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \ -e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g' Bug: 35841464 Test: make droid cts Change-Id: I060c7236b7607763e5d27d60aa395d2507703a95
* Port JSR166 LinkedTransferQueueTest flakiness fixTobias Thierer2017-02-193-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL cherry-picks the following upstream (*) test changes ("upstream" here is JSR166's CVS repository cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' This is in contrast to the code under test, whose upstream is OpenJDK). ===== src/test/tck/LinkedTransferQueueTest.java revision 1.70 date: 2017/02/18 16:37:49; author: jsr166; state: Exp; lines: +11 -5 waitForThreadToEnterWaitState should fail on timeout; tests should tolerate transient blocking Thread.State at any time (e.g. due to classloading) src/test/tck/JSR166TestCase.java revision 1.219 date: 2017/02/18 16:37:49; author: jsr166; state: Exp; lines: +43 -3 waitForThreadToEnterWaitState should fail on timeout; tests should tolerate transient blocking Thread.State at any time (e.g. due to classloading) src/test/tck/PhaserTest.java revision 1.45 date: 2017/02/18 15:05:55; author: jsr166; state: Exp; lines: +10 -10 use default timeout of LONG_DELAY_MS with waitForThreadToEnterWaitState ====== The effect of this CL is to fix flakiness in LinkedTransferQueueTest's testTransfer2() and testWaitingConsumer(). These test methods need to wait until a background thread was blocked waiting on a LinkedTransferQueue; before this CL, they did so by calling a helper method that waited for the background thread's state to become WAITING, TIMED_WAITING, or BLOCKED. After this CL, they also check that the LinkedTransferQueue is in the expected state before they stop waiting. The additional check is necessary because LinkedTransferQueue uses LockSupport.park(), which on Android involves a synchronized lock and therefore BLOCKED state. This caused the test methods to prematurely stop waiting, which caused the test to fail. The concrete failure could also have been prevented by waiting for the thread to enter WAITING or TIMED_WAITING state rather than BLOCKED. This was considered but not chosen by upstream since it would still have made assumptions about those states not being entered elsewhere. This CL also changes the waiting logic to fail() the test upon timeout. PhaserTest was changed to use longer timeouts (10sec rather than 250msec) to avoid flaky timeout failures. Bug: 34814528 Test: LinkedTransferQueueTest Test: PhaserTest Test: Checked that testTransfer2() and testWaitingConsumer() are non-flaky by running their body 10,000 times each in a loop. Change-Id: I112ee1fba8aea6ca97ca0f99bba0fc9f00e5c0c2
* Add Android-changed on modifications to workaround an ECJ bugmikaelpeltier2016-12-091-0/+1
| | | | | | | Test: N/A Bug: 33371837 Change-Id: I8d0d5748665509be3dbcdf47c0527e01ef3b68e9
* Workaround of a Jack front-end bug related to type inferencemikaelpeltier2016-12-091-1/+1
| | | | | | | | | | | | | - ECJ 4.7 M3 fails to infer type in some cases, thus add a cast to the expected type to workaround the bug. Test: m -j32 (release bullhead userdebug) Bug: 33371837 (cherry picked from commit 918efe9ba819b7a03729b6f6ef7ead2f70a20447) Change-Id: I50326ddd753cc4bf6d1dfd349a046626d7e1fc33
* Make CollectionTest and Collection8Test abstract.Nicholas Sauer2016-05-182-2/+4
| | | | | | | | | | These classes are meant to be extended, but the test runner tries to run them anyway which causes a warning message to surfaced as a test result. Making them abstract allows them to be used by subclasses. bug: 28503384 Change-Id: I45c34dde7f045aa6721352508df463c69c2cd8ef
* ConcurrentHashMap: update API for keySet.Narayan Kamath2016-04-121-1/+1
| | | | | | | | | | | | | | | On Android M and earlier, keySet() returned a Set<K>. Changing the return type to a type that doesn't exist on previous releases is an incompatible change. We therefore revert it so that applications that compile against the Android N SDK will continue to work on older releases. Note that there is no API update that accompanies this change. Due to an asymmetry in doclava, this method is absent from the *api.txt files but *does* exist in the stubs. bug: 28099367 Change-Id: Ife90592847de1752cd33efdb2e7e0ec082df42fc
* Add openJdk8 java.util.stream packageIgor Murashkin2016-03-183-299/+295
| | | | | | | | | | | | | | | | | | | Based on openJdk 8u60 source & iam@ stream prototype in ag/872080 Uncommented all code that was waiting for java.util.stream to show up Differences from original sources: - Removed unsignedDivision usage from LongStream, it's not currently supported and we don't expect that large workloads on mobile devices. - Removed java.nio.file references. - Removed (yet) not implemented stream-related methods from other packages listed in package-info.java. Bug: 27692239 Change-Id: Ie24e60e8248367b576ef91046837ccde152de373 (cherry picked from commit d0a2645e29a9b84d7e5ec822eb9904e93bd6c013)
* Adjust ThreadPoolExecutorTest#testPoolSizeInvariantsPrzemyslaw Szczepaniak2016-03-171-2/+7
| | | | | | | | | | | | Commit dfec9b5386ca028cc1468f3e2717120ab6274702 alters how ThreadPoolExecutor#setCorePoolSize behaves. This change fixes #testPoolSizeInvariants to take it into account. Bug: 27702221 (cherry picked from commit d943f38ce56cd5b3280359975722ec9270a050e7) Change-Id: I4cbc5f7d83a8d82e67ac8d539cc3df375e48cc8a
* Fix for CollectionTest not running properly on vogar + missing testsPrzemyslaw Szczepaniak2016-03-154-6/+48
| | | | | | | | | | | Made CollectionTest non-public, is shouldn't cause problems with vogar anymore. Also, CTS currently doesn't find nested tests, so I've moved some from the LinkedTransferQueueTest to separate files. Bug: 27673907 Change-Id: Iee6ecdee3128353f360ead7641cbafcb331f5644 (cherry picked from commit 7fe9db6dc16a8c5f58e1b4657967b71138e1f3ce)
* JSR-166 update without java 1.9 method/classesPrzemyslaw Szczepaniak2016-03-1581-3721/+15456
| | | | | | | | | | | | | | | Second attempt, in frist one I've submitted some code from openJdk 1.9 that shouldn't be here, orignial change can be found at 5328e07d282bef36ac8b757bbee16a761415b2c4 Adapted from sources taken from CVS using: cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/03/2016 10:00:00 GMT" jsr166 This time with hidden/removed "@since 9" methods and classes Bug: 27426599 Change-Id: Ibd8d26e13cba091bfd983c73d005e4f8d8f5946d (cherry picked from commit b8b75116273ecfdb8ffdd1869b1c0dd04570a95e)
* Temporarily wait without timeouts in two jsr166 tests for debugging.Hiroshi Yamauchi2016-01-052-2/+17
| | | | | | | | | | | | | | | To help figure out whether a locally non-reproducible but buildbot-reproducible test failure is a timeout issue or something else, change the wait code to wait without timeouts in testWaitingConsumer and testTransfer2. This is a temporary change for a debugging purpose and to be reverted. This shouldn't affect the effectiveness of the tests because the test code assumes timeouts mean test failures. Bug: 25883050 Bug: 12687968 Change-Id: Iffd0377de5a416a308233e8b3cc345a83bdc406a
* Fix JSR-166 tests.Narayan Kamath2015-04-303-31/+10
| | | | | | | | | | | | | | - Remove calls to setSecurityManager, which throws unconditionally on android. - Remove an unsupported AccessController check. - Remove an assertion that the default uncaught exception handler is null. Regular android processes always have one installed. bug: 20628776 (cherry picked from commit 151f344e88956741c0b8e4018df845d85d4eef25) Change-Id: Ida7499c74586d007b8381522bec45f9a0c8fa7b4
* Update JSR166 tck tests.Narayan Kamath2015-04-3068-1226/+2776
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following tests have been omitted because they are unsupported : - Atomic8Test.java - CompletableFutureTest.java - ConcurrentHashMap8Test.java - DoubleAccumulatorTest.java - DoubleAdderTest.java - ForkJoinPool8Test.java - ForkJoinTask8Test.java - LongAccumulatorTest.java - LongAdderTest.java - SplittableRandomTest.java - StampedLockTest.java - ThreadLocalRandom8Test.java - ThreadPoolExecutor9Test.java A package declaration has been added to all files (package jsr166;) and the base-class JSR166Test has been changed not to rely on features that aren't available on android / junit in the android environment. We also avoid using junit4 style TestSuite declarations. While the CTS test runner handles them properly usually, it trips over itself when it encounters a failure and tries to run each test in an invidual process and fails each test for no good reason (needs investigation on the CTS side of things) bug: 20628776 (cherry picked from commit 5da8b2b3cac51f0f592a5e1941bd84eade9648cd) Change-Id: If35be0881ad8da4c604ce6683149b15c1a85f289
* Fix jsr166 testsCalin Juravle2014-05-1617-73/+211
| | | | | | | | | | Tests specified as static inner classes were failing because the CTS runner does not support them. The temporary fix is to promote all static inner test classes to top level classes. This should be reverted once the CTS runner is fixed. Bug: 13877168 Change-Id: Icb64d7d7fcf6202d54d6fe31d9e1c9a6a43a233b
* Added jsr166 tck tests as part of the libcore testsuite.Calin Juravle2013-08-1467-0/+48956
Change-Id: I6094d734f818fa043f2b277cf2b4ec7fec68e26e