From a387f058b1742c75a2c9aba8661e5b85c659b24a Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Sat, 6 Jun 2009 22:28:37 +0000 Subject: [PATCH] Added tests for format 21t git-svn-id: https://smali.googlecode.com/svn/trunk@108 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- .../Format21t/Format21t.smali | 149 ++++++++++++++++++ src/test/smali/junit-tests/TestSuite.smali | 1 + 2 files changed, 150 insertions(+) create mode 100644 src/test/smali/junit-tests/InstructionTests/Format21t/Format21t.smali diff --git a/src/test/smali/junit-tests/InstructionTests/Format21t/Format21t.smali b/src/test/smali/junit-tests/InstructionTests/Format21t/Format21t.smali new file mode 100644 index 00000000..86be6e9f --- /dev/null +++ b/src/test/smali/junit-tests/InstructionTests/Format21t/Format21t.smali @@ -0,0 +1,149 @@ +.class public LFormat21t; +.super Ljava/lang/Object; +.source "Format21t.smali" + +.method public constructor ()V + .registers 1 + invoke-direct {p0}, Ljava/lang/Object;->()V + return-void +.end method + +.method public test_if-eqz()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, 0 + + if-eqz v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, 1 + + if-eqz v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method + + +.method public test_if-nez()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, 1 + + if-nez v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, 0 + + if-nez v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method + +.method public test_if-ltz()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, -1 + + if-ltz v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, 0 + + if-ltz v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method + +.method public test_if-gez()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, 0 + + if-gez v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, -1 + + if-gez v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method + +.method public test_if-gtz()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, 1 + + if-gtz v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, 0 + + if-gtz v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method + + +.method public test_if-lez()V + .registers 1 + .annotation runtime Lorg/junit/Test; + .end annotation + + const/4 v0, 0 + + if-lez v0, label1: + + invoke-static {}, Lorg/junit/Assert;->fail()V + + label1: + const/4 v0, 1 + + if-lez v0, label2: + return-void + + label2: + invoke-static {}, Lorg/junit/Assert;->fail()V + + return-void +.end method \ No newline at end of file diff --git a/src/test/smali/junit-tests/TestSuite.smali b/src/test/smali/junit-tests/TestSuite.smali index 52febb50..ec72d8b4 100644 --- a/src/test/smali/junit-tests/TestSuite.smali +++ b/src/test/smali/junit-tests/TestSuite.smali @@ -28,6 +28,7 @@ LFormat11x;, LFormat12x;, LFormat20t;, + LFormat21t;, LFormat22x;, LFormat30t; }