diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/800-smali/expected.txt | 2 | ||||
| -rw-r--r-- | test/800-smali/smali/b_18380491AbstractBase.smali | 12 | ||||
| -rw-r--r-- | test/800-smali/smali/b_18380491ConcreteClass.smali | 19 | ||||
| -rw-r--r-- | test/800-smali/src/Main.java | 8 |
4 files changed, 41 insertions, 0 deletions
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt index 1b813bf0c8..01d7b8164f 100644 --- a/test/800-smali/expected.txt +++ b/test/800-smali/expected.txt @@ -3,4 +3,6 @@ b/17978759 FloatBadArgReg negLong sameFieldNames +b/18380491 +invoke-super abstract Done! diff --git a/test/800-smali/smali/b_18380491AbstractBase.smali b/test/800-smali/smali/b_18380491AbstractBase.smali new file mode 100644 index 0000000000..7aa1b1a12e --- /dev/null +++ b/test/800-smali/smali/b_18380491AbstractBase.smali @@ -0,0 +1,12 @@ +.class public LB18380491ActractBase; + +.super Ljava/lang/Object; + +.method public constructor <init>()V + .locals 0 + invoke-direct {p0}, Ljava/lang/Object;-><init>()V + return-void +.end method + +.method public abstract foo(I)I +.end method diff --git a/test/800-smali/smali/b_18380491ConcreteClass.smali b/test/800-smali/smali/b_18380491ConcreteClass.smali new file mode 100644 index 0000000000..db5ef3ba6b --- /dev/null +++ b/test/800-smali/smali/b_18380491ConcreteClass.smali @@ -0,0 +1,19 @@ +.class public LB18380491ConcreteClass; + +.super LB18380491ActractBase; + +.method public constructor <init>()V + .locals 0 + invoke-direct {p0}, LB18380491ActractBase;-><init>()V + return-void +.end method + +.method public foo(I)I + .locals 1 + if-eqz p1, :invoke_super_abstract + return p1 + :invoke_super_abstract + invoke-super {p0, p1}, LB18380491ActractBase;->foo(I)I + move-result v0 + return v0 +.end method diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java index 3a0f8eaee6..3f613efd78 100644 --- a/test/800-smali/src/Main.java +++ b/test/800-smali/src/Main.java @@ -14,6 +14,7 @@ * limitations under the License. */ +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.LinkedList; @@ -55,6 +56,10 @@ public class Main { new Object[]{100}, null, 100)); testCases.add(new TestCase("negLong", "negLong", "negLong", null, null, 122142L)); testCases.add(new TestCase("sameFieldNames", "sameFieldNames", "getInt", null, null, 7)); + testCases.add(new TestCase("b/18380491", "B18380491ConcreteClass", "foo", + new Object[]{42}, null, 42)); + testCases.add(new TestCase("invoke-super abstract", "B18380491ConcreteClass", "foo", + new Object[]{0}, new AbstractMethodError(), null)); } public void runTests() { @@ -116,6 +121,9 @@ public class Main { } catch (Throwable exc) { if (tc.expectedException == null) { errorReturn = new IllegalStateException("Did not expect exception", exc); + } else if (exc instanceof InvocationTargetException && exc.getCause() != null && + exc.getCause().getClass().equals(tc.expectedException.getClass())) { + // Expected exception is wrapped in InvocationTargetException. } else if (!tc.expectedException.getClass().equals(exc.getClass())) { errorReturn = new IllegalStateException("Expected " + tc.expectedException.getClass().getName() + |