mirror of
https://github.com/revanced/smali.git
synced 2025-05-28 20:00:13 +02:00
update integration tests to use new label format
git-svn-id: https://smali.googlecode.com/svn/trunk@484 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
dade116d27
commit
688d1b1295
@ -13,15 +13,15 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
try_start:
|
||||
:try_start
|
||||
new-instance v0, Ljava/lang/Exception;
|
||||
const-string v1, "This is an error message"
|
||||
invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
||||
throw v0
|
||||
try_end:
|
||||
.catch Ljava/lang/Exception; {try_start: .. try_end:} handler:
|
||||
:try_end
|
||||
.catch Ljava/lang/Exception; {:try_start .. :try_end} :handler
|
||||
|
||||
handler:
|
||||
:handler
|
||||
#no need to test anything. If it didn't catch the exception, the test would fail
|
||||
return-void
|
||||
.end method
|
||||
@ -32,28 +32,28 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
try_start_outer:
|
||||
:try_start_outer
|
||||
nop
|
||||
nop
|
||||
|
||||
try_start_inner:
|
||||
:try_start_inner
|
||||
new-instance v0, Ljava/lang/RuntimeException;
|
||||
const-string v1, "This is an error message"
|
||||
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
||||
throw v0
|
||||
try_end_inner:
|
||||
.catch Ljava/lang/RuntimeException; {try_start_inner: .. try_end_outer:} handler_inner:
|
||||
:try_end_inner
|
||||
.catch Ljava/lang/RuntimeException; {:try_start_inner .. :try_end_outer} :handler_inner
|
||||
|
||||
nop
|
||||
nop
|
||||
try_end_outer:
|
||||
:try_end_outer
|
||||
|
||||
.catch Ljava/lang/Exception; {try_start_outer: .. try_end_outer:} handler_outer:
|
||||
.catch Ljava/lang/Exception; {:try_start_outer .. :try_end_outer} :handler_outer
|
||||
|
||||
handler_outer:
|
||||
:handler_outer
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
handler_inner:
|
||||
:handler_inner
|
||||
|
||||
|
||||
return-void
|
||||
@ -66,15 +66,15 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
try_start:
|
||||
:try_start
|
||||
new-instance v0, Ljava/lang/Exception;
|
||||
const-string v1, "This is an error message"
|
||||
invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
||||
throw v0
|
||||
try_end:
|
||||
.catchall {try_start: .. try_end:} handler:
|
||||
:try_end
|
||||
.catchall {:try_start .. :try_end} :handler
|
||||
|
||||
handler:
|
||||
:handler
|
||||
#no need to test anything. If it didn't catch the exception, the test would fail
|
||||
return-void
|
||||
.end method
|
@ -16,9 +16,9 @@
|
||||
|
||||
const v0, 5
|
||||
|
||||
goto label:
|
||||
goto :label
|
||||
|
||||
label2:
|
||||
:label2
|
||||
|
||||
|
||||
const v1, 6
|
||||
@ -27,9 +27,9 @@
|
||||
|
||||
|
||||
|
||||
label:
|
||||
:label
|
||||
const v0, 6
|
||||
goto label2:
|
||||
goto :label2
|
||||
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->assertFalse()V
|
||||
|
@ -74,16 +74,16 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
startTry:
|
||||
:startTry
|
||||
const-string v0, "This is an exception message"
|
||||
new-instance v1, Ljava/lang/Exception;
|
||||
invoke-direct {v1, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V
|
||||
throw v1
|
||||
endTry:
|
||||
:endTry
|
||||
|
||||
.catch Ljava/lang/Exception; {startTry: .. endTry:} handler:
|
||||
.catch Ljava/lang/Exception; {:startTry .. :endTry} :handler
|
||||
|
||||
handler:
|
||||
:handler
|
||||
move-exception v0
|
||||
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
|
||||
move-result-object v1
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
const v0, 5
|
||||
|
||||
goto/16 label:
|
||||
goto/16 :label
|
||||
|
||||
label2:
|
||||
:label2
|
||||
|
||||
|
||||
const v1, 6
|
||||
@ -1069,9 +1069,9 @@
|
||||
|
||||
|
||||
|
||||
label:
|
||||
:label
|
||||
const v0, 6
|
||||
goto/16 label2:
|
||||
goto/16 :label2
|
||||
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->assertFalse()V
|
||||
|
@ -42,17 +42,17 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
tryStart:
|
||||
:tryStart
|
||||
const-string v0, "test"
|
||||
|
||||
check-cast v0, Ljava/io/PrintStream;
|
||||
tryEnd:
|
||||
.catch Ljava/lang/ClassCastException; {tryStart: .. tryEnd:} handler:
|
||||
:tryEnd
|
||||
.catch Ljava/lang/ClassCastException; {:tryStart .. :tryEnd} :handler
|
||||
|
||||
#the check-cast didn't throw an exception as expected
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
handler:
|
||||
:handler
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@ -62,16 +62,16 @@
|
||||
.annotation runtime Lorg/junit/Test;
|
||||
.end annotation
|
||||
|
||||
tryStart:
|
||||
:tryStart
|
||||
const-string v0, "test"
|
||||
|
||||
check-cast v0, Ljava/lang/Object;
|
||||
tryEnd:
|
||||
.catch Ljava/lang/ClassCastException; {tryStart: .. tryEnd:} handler:
|
||||
:tryEnd
|
||||
.catch Ljava/lang/ClassCastException; {:tryStart .. :tryEnd} :handler
|
||||
|
||||
return-void
|
||||
|
||||
handler:
|
||||
:handler
|
||||
|
||||
#the check-cast incorrectlly threw an exception as expected
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
@ -15,17 +15,17 @@
|
||||
|
||||
const/4 v0, 0
|
||||
|
||||
if-eqz v0, label1:
|
||||
if-eqz v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, 1
|
||||
|
||||
if-eqz v0, label2:
|
||||
if-eqz v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -39,17 +39,17 @@
|
||||
|
||||
const/4 v0, 1
|
||||
|
||||
if-nez v0, label1:
|
||||
if-nez v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, 0
|
||||
|
||||
if-nez v0, label2:
|
||||
if-nez v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -62,17 +62,17 @@
|
||||
|
||||
const/4 v0, -1
|
||||
|
||||
if-ltz v0, label1:
|
||||
if-ltz v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, 0
|
||||
|
||||
if-ltz v0, label2:
|
||||
if-ltz v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -85,17 +85,17 @@
|
||||
|
||||
const/4 v0, 0
|
||||
|
||||
if-gez v0, label1:
|
||||
if-gez v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, -1
|
||||
|
||||
if-gez v0, label2:
|
||||
if-gez v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -108,17 +108,17 @@
|
||||
|
||||
const/4 v0, 1
|
||||
|
||||
if-gtz v0, label1:
|
||||
if-gtz v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, 0
|
||||
|
||||
if-gtz v0, label2:
|
||||
if-gtz v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -132,17 +132,17 @@
|
||||
|
||||
const/4 v0, 0
|
||||
|
||||
if-lez v0, label1:
|
||||
if-lez v0, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const/4 v0, 1
|
||||
|
||||
if-lez v0, label2:
|
||||
if-lez v0, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
|
@ -17,17 +17,17 @@
|
||||
const v0, 23
|
||||
const v1, 23
|
||||
|
||||
if-eq v0, v1, label1:
|
||||
if-eq v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 24
|
||||
|
||||
if-eq v0, v1, label2:
|
||||
if-eq v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -41,17 +41,17 @@
|
||||
const v0, 23
|
||||
const v1, 24
|
||||
|
||||
if-ne v0, v1, label1:
|
||||
if-ne v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 23
|
||||
|
||||
if-ne v0, v1, label2:
|
||||
if-ne v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -65,17 +65,17 @@
|
||||
const v0, 23
|
||||
const v1, 24
|
||||
|
||||
if-lt v0, v1, label1:
|
||||
if-lt v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 23
|
||||
|
||||
if-lt v0, v1, label2:
|
||||
if-lt v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -89,17 +89,17 @@
|
||||
const v0, 23
|
||||
const v1, 23
|
||||
|
||||
if-ge v0, v1, label1:
|
||||
if-ge v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 24
|
||||
|
||||
if-ge v0, v1, label2:
|
||||
if-ge v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -113,17 +113,17 @@
|
||||
const v0, 23
|
||||
const v1, 22
|
||||
|
||||
if-gt v0, v1, label1:
|
||||
if-gt v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 23
|
||||
|
||||
if-gt v0, v1, label2:
|
||||
if-gt v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
@ -137,17 +137,17 @@
|
||||
const v0, 23
|
||||
const v1, 23
|
||||
|
||||
if-le v0, v1, label1:
|
||||
if-le v0, v1, :label1
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
label1:
|
||||
:label1
|
||||
const v1, 22
|
||||
|
||||
if-le v0, v1, label2:
|
||||
if-le v0, v1, :label2
|
||||
return-void
|
||||
|
||||
label2:
|
||||
:label2
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
|
||||
return-void
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
const v0, 5
|
||||
|
||||
goto/32 label:
|
||||
goto/32 :label
|
||||
|
||||
label2:
|
||||
:label2
|
||||
|
||||
const v1, 6
|
||||
invoke-static {v0, v1}, LAssert;->assertEquals(II)V
|
||||
@ -70748,9 +70748,9 @@
|
||||
nop
|
||||
|
||||
|
||||
label:
|
||||
:label
|
||||
const v0, 6
|
||||
goto/32 label2:
|
||||
goto/32 :label2
|
||||
|
||||
|
||||
invoke-static {}, Lorg/junit/Assert;->assertFalse()V
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
const v0, 6
|
||||
new-array v0, v0, [I
|
||||
fill-array-data v0, ArrayData:
|
||||
fill-array-data v0, :ArrayData
|
||||
|
||||
const v1, 0
|
||||
aget v2, v0, v1
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
return-void
|
||||
|
||||
ArrayData:
|
||||
:ArrayData
|
||||
.array-data 4
|
||||
1 2 3 4 5 6
|
||||
.end array-data
|
||||
@ -62,30 +62,30 @@ ArrayData:
|
||||
|
||||
const v0, 12
|
||||
|
||||
switch:
|
||||
packed-switch v0, PackedSwitch:
|
||||
:switch
|
||||
packed-switch v0, :PackedSwitch
|
||||
|
||||
Label10:
|
||||
:Label10
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
Label11:
|
||||
:Label11
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
Label12:
|
||||
:Label12
|
||||
return-void
|
||||
|
||||
Label13:
|
||||
:Label13
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
PackedSwitch:
|
||||
:PackedSwitch
|
||||
.packed-switch 10
|
||||
Label10:
|
||||
Label11:
|
||||
Label12:
|
||||
Label13:
|
||||
:Label10
|
||||
:Label11
|
||||
:Label12
|
||||
:Label13
|
||||
.end packed-switch
|
||||
.end method
|
||||
|
||||
@ -97,35 +97,35 @@ PackedSwitch:
|
||||
|
||||
const v0, 13
|
||||
|
||||
switch:
|
||||
sparse-switch v0, SparseSwitch:
|
||||
:switch
|
||||
sparse-switch v0, :SparseSwitch
|
||||
|
||||
Label10:
|
||||
:Label10
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
Label20:
|
||||
:Label20
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
Label15:
|
||||
:Label15
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
Label13:
|
||||
:Label13
|
||||
return-void
|
||||
|
||||
Label99:
|
||||
:Label99
|
||||
invoke-static {}, Lorg/junit/Assert;->fail()V
|
||||
return-void
|
||||
|
||||
SparseSwitch:
|
||||
:SparseSwitch
|
||||
.sparse-switch
|
||||
10 -> Label10:
|
||||
13 -> Label13:
|
||||
15 -> Label15:
|
||||
20 -> Label20:
|
||||
99 -> Label99:
|
||||
10 -> :Label10
|
||||
13 -> :Label13
|
||||
15 -> :Label15
|
||||
20 -> :Label20
|
||||
99 -> :Label99
|
||||
.end sparse-switch
|
||||
.end method
|
||||
|
||||
|
@ -33,21 +33,21 @@
|
||||
|
||||
const v0, 12
|
||||
|
||||
packed-switch v0, PackedSwitch:
|
||||
packed-switch v0, :PackedSwitch
|
||||
|
||||
Label10:
|
||||
:Label10
|
||||
const v1, 10
|
||||
return v1
|
||||
|
||||
Label11:
|
||||
:Label11
|
||||
const v1, 11
|
||||
return v1
|
||||
|
||||
Label12:
|
||||
:Label12
|
||||
const v1, 12
|
||||
return v1
|
||||
|
||||
Label13:
|
||||
:Label13
|
||||
const v1, 13
|
||||
return v1
|
||||
|
||||
@ -56,12 +56,12 @@ Label13:
|
||||
#data to force alignment
|
||||
nop
|
||||
|
||||
PackedSwitch:
|
||||
:PackedSwitch
|
||||
.packed-switch 10
|
||||
Label10:
|
||||
Label11:
|
||||
Label12:
|
||||
Label13:
|
||||
:Label10
|
||||
:Label11
|
||||
:Label12
|
||||
:Label13
|
||||
.end packed-switch
|
||||
.end method
|
||||
|
||||
@ -92,32 +92,32 @@ PackedSwitch:
|
||||
|
||||
const v0, 12
|
||||
|
||||
packed-switch v0, PackedSwitch:
|
||||
packed-switch v0, :PackedSwitch
|
||||
|
||||
packed-switch v0, PackedSwitch2:
|
||||
packed-switch v0, :PackedSwitch2
|
||||
|
||||
Label10:
|
||||
:Label10
|
||||
const v1, 10
|
||||
return v1
|
||||
|
||||
Label11:
|
||||
:Label11
|
||||
const v1, 11
|
||||
return v1
|
||||
|
||||
Label12:
|
||||
:Label12
|
||||
const v1, 12
|
||||
return v1
|
||||
|
||||
Label13:
|
||||
:Label13
|
||||
const v1, 13
|
||||
return v1
|
||||
|
||||
PackedSwitch:
|
||||
:PackedSwitch
|
||||
.packed-switch 10
|
||||
Label10:
|
||||
Label11:
|
||||
Label12:
|
||||
Label13:
|
||||
:Label10
|
||||
:Label11
|
||||
:Label12
|
||||
:Label13
|
||||
.end packed-switch
|
||||
|
||||
#this tests out an issue that occured where the prior packed switch data starts at a byte offset
|
||||
@ -129,12 +129,12 @@ PackedSwitch:
|
||||
#is aligned, and won't output the extra nop to align it, thus causing a verification error.
|
||||
nop
|
||||
|
||||
PackedSwitch2:
|
||||
:PackedSwitch2
|
||||
.packed-switch 10
|
||||
Label10:
|
||||
Label11:
|
||||
Label12:
|
||||
Label13:
|
||||
:Label10
|
||||
:Label11
|
||||
:Label12
|
||||
:Label13
|
||||
.end packed-switch
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user