summaryrefslogtreecommitdiff
path: root/test/008-exceptions/src
AgeCommit message (Collapse)Author
2020-07-26More inclusive language fixesOrion Hodson
Bug: 161896447 Bug: 161850439 Bug: 161336379 Test: art/test.py --host Change-Id: I1519e22d40cb28f243dd75b12d455cfa844726fc
2018-01-05Change ClassStatus to fit into 4 bits.Vladimir Marko
In preparation for extending the type check bit string from 24 to 28 bits, rewrite ClassStatus to fit into 4 bits. Also perform a proper cleanup of the ClassStatus, i.e. change it to an enum class, remove the "Status" word from enumerator names, replace "Max" with "Last" in line with other enumerations and remove aliases from mirror::Class. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 64692057 Bug: 65318848 Change-Id: Iec1610ba5dac2c527b36c12819f132e1a77f2d45
2017-06-02Tests: never use System.errKevin Brodsky
Always print stack traces to System.out, and replace all System.err.println()'s with System.out.println(). Follow-up of https://android-review.googlesource.com/#/c/187020/ and https://android-review.googlesource.com/#/c/407032/. Test: m test-art-host m test-art-target Change-Id: I9ab9cd955a8db25b2ec6673790e5bc924f62c88a
2017-01-24Add class status for resolved erroneous classes.Vladimir Marko
Split the old ambiguous status mirror::Class::kStatusError into kStatusErrorUnresolved and kStatusErrorResolved. Once a class has been resolved, IsResolved() shall return true even if the class later becomes erroneous. Allow returning erroneous class from ClassLinker::EnsureResolved() if it has been previously resolved. This allows consistent behavior for retrieving classes, immune to multi-threaded races and multi-dex weirdness. It also allows JVMTI to properly report "prepared" (i.e. resolved) classes that are also erroneous. The new behavior is consistent with the RI. Add regression tests to 008-exceptions for inconsistent behavior for multi-dex retrieval of erroneous resolved class (wrapping or not wrapping the old exception based on which dex file is used for lookup) and for a CHECK(IsResolved()) crash in ClassLinker::LoadSuperAndInterfaces() (without any tests for similar checks that could have previously failed only due to extremely unlikely race conditions; these should now also be fixed). Inconsistency still remains for class verification as shown by the new exceptionsForSuperClassInitFailure() test in 008-exceptions, where interpreter and Optimizing still cause different exceptions to be thrown. Note: This is partially changing behavior implemented for bug 28787733. Since we allow the class loader to retrieve an erroneous resolved class, the ExceptionInInitializerError is not thrown at all from VMClassLoader_findLoadedClass(), so there is nothing to wrap in ClassNotFoundException. Test: m test-art-host Bug: 30627598 Bug: 28787733 Change-Id: I86cdca00f35a0d6221d2559e3026ac0428a3613c
2015-12-16Make the 008-exceptions test print everything to stdoutKevin Brodsky
Printing to different streams (stderr and stdout) may cause the messages to be interleaved, making the test fail. Without this patch, this kind of outcome has been observed: --- expected.txt 2015-12-09 08:13:50.583294910 +0000 +++ output.txt 2015-12-09 08:55:35.635185771 +0000 @@ -1,15 +1,15 @@ Got an NPE: second throw java.lang.NullPointerException: second throw - at Main.catchAndRethrow(Main.java:77) +Static Init +BadError: This is bad by convention: BadInit +java.lang.NoClassDefFoundError: BadInit at Main.catchAndRethrow(Main.java:77) at Main.exceptions_007(Main.java:59) at Main.main(Main.java:67) Caused by: java.lang.NullPointerException: first throw at Main.throwNullPointerException(Main.java:84) at Main.catchAndRethrow(Main.java:74) ... 2 more -Static Init -BadError: This is bad by convention: BadInit -java.lang.NoClassDefFoundError: BadInit + BadError: This is bad by convention: BadInit Static BadInitNoStringInit BadErrorNoStringInit: This is bad by convention Change-Id: Iaabf5ed593d100abf157adf46c1761338227d2cf
2015-11-04ART: Change behavior for rethrowing init failures (2)Andreas Gampe
Always store the pending exception when making a class erroneous. Instead of filtering by ExceptionInInitializerError, add an option to the rethrow that enforces a NoClassDefFoundError, which is required by the specification. Use the libcore companion change to add the stored error (if any) as a cause to the NoClassDefFoundError, which should significantly help tracking down issues. Fix run-test 008 to expect spec-compliant behavior. Test that a cause has been set. Bug: 25445103 Change-Id: I6a0dc54e78312283faf23415887eff387531407f
2015-11-04ART: Change behavior for rethrowing init failuresAndreas Gampe
Allow to store a Throwable instance or a throwable class. Handle rethrow accordingly. Bug: 25444180 Change-Id: I703c2c6eaf34ad0e3bc0f5a104d65f2ff1b212ca
2015-04-22ART: Fix re-throwing failures of non-convention errorsAndreas Gampe
While it is convention that Throwable subclasses should have a constructor with a String argument, that is not rigorously enforced. So if a static initializer throws an error that omits that constructor, we must not provide a message when trying to throw again. Bug: 20495321 Bug: 20497840 Change-Id: Ia4334fa24223750f90a8f2732f1eb1e738575e8d
2014-07-23ART: Make run tests out of oat testsAndreas Gampe
Transforms all former oat tests into run tests. Change-Id: I190dd39456454c36e5538a2c044d993965a67533