Home | History | Annotate | Download | only in if_lez
      1 package dot.junit.opcodes.if_lez;
      2 
      3 import dot.junit.DxTestCase;
      4 import dot.junit.DxUtil;
      5 import dot.junit.opcodes.if_lez.d.T_if_lez_1;
      6 import dot.junit.opcodes.if_lez.d.T_if_lez_2;
      7 
      8 public class Test_if_lez extends DxTestCase {
      9 
     10     /**
     11      * @title Argument = 5
     12      */
     13     public void testN1() {
     14         T_if_lez_1 t = new T_if_lez_1();
     15         assertEquals(1234, t.run(5));
     16     }
     17 
     18     /**
     19      * @title Argument = -5
     20      */
     21     public void testN2() {
     22         T_if_lez_1 t = new T_if_lez_1();
     23         assertEquals(1, t.run(-5));
     24     }
     25 
     26     /**
     27      * @title Arguments = Integer.MAX_VALUE
     28      */
     29     public void testB1() {
     30         T_if_lez_1 t = new T_if_lez_1();
     31         assertEquals(1234, t.run(Integer.MAX_VALUE));
     32     }
     33 
     34     /**
     35      * @title Arguments = Integer.MIN_VALUE
     36      */
     37     public void testB2() {
     38         T_if_lez_1 t = new T_if_lez_1();
     39         assertEquals(1, t.run(Integer.MIN_VALUE));
     40     }
     41 
     42     /**
     43      * @title Arguments = 0
     44      */
     45     public void testB3() {
     46         T_if_lez_1 t = new T_if_lez_1();
     47         assertEquals(1, t.run(0));
     48     }
     49 
     50     /**
     51      * @constraint A23
     52      * @title number of registers
     53      */
     54     public void testVFE1() {
     55         load("dot.junit.opcodes.if_lez.d.T_if_lez_3", VerifyError.class);
     56     }
     57 
     58 
     59 
     60     /**
     61      * @constraint B1
     62      * @title types of arguments - double
     63      */
     64     public void testVFE2() {
     65         load("dot.junit.opcodes.if_lez.d.T_if_lez_4", VerifyError.class);
     66     }
     67 
     68     /**
     69      * @constraint B1
     70      * @title types of arguments - long
     71      */
     72     public void testVFE3() {
     73         load("dot.junit.opcodes.if_lez.d.T_if_lez_5", VerifyError.class);
     74     }
     75 
     76     /**
     77      * @constraint B1
     78      * @title types of arguments - reference
     79      */
     80     public void testVFE4() {
     81         load("dot.junit.opcodes.if_lez.d.T_if_lez_6", VerifyError.class);
     82     }
     83 
     84     /**
     85      * @constraint A6
     86      * @title  branch target shall be inside the method
     87      */
     88     public void testVFE5() {
     89         load("dot.junit.opcodes.if_lez.d.T_if_lez_8", VerifyError.class);
     90     }
     91 
     92     /**
     93      * @constraint A6
     94      * @title branch target shall not be "inside" instruction
     95      */
     96     public void testVFE6() {
     97         load("dot.junit.opcodes.if_lez.d.T_if_lez_9", VerifyError.class);
     98     }
     99 
    100     /**
    101      * @constraint n/a
    102      * @title branch must not be 0
    103      */
    104     public void testVFE7() {
    105         load("dot.junit.opcodes.if_lez.d.T_if_lez_10", VerifyError.class);
    106     }
    107 
    108     /**
    109      * @constraint B1
    110      * @title Type of argument - float. The verifier checks that ints
    111      * and floats are not used interchangeably.
    112      */
    113     public void testVFE8() {
    114         load("dot.junit.opcodes.if_lez.d.T_if_lez_2", VerifyError.class);
    115     }
    116 
    117 }
    118