Home | History | Annotate | Download | only in if_le
      1 package dot.junit.opcodes.if_le;
      2 
      3 import dot.junit.DxTestCase;
      4 import dot.junit.DxUtil;
      5 import dot.junit.opcodes.if_le.d.T_if_le_1;
      6 import dot.junit.opcodes.if_le.d.T_if_le_11;
      7 
      8 public class Test_if_le extends DxTestCase {
      9 
     10     /**
     11      * @title Case: 5 < 6
     12      */
     13     public void testN1() {
     14         T_if_le_1 t = new T_if_le_1();
     15         assertEquals(1, t.run(5, 6));
     16     }
     17 
     18     /**
     19      * @title Case: 0x0f0e0d0c = 0x0f0e0d0c
     20      */
     21     public void testN2() {
     22         T_if_le_1 t = new T_if_le_1();
     23         assertEquals(1, t.run(0x0f0e0d0c, 0x0f0e0d0c));
     24     }
     25 
     26     /**
     27      * @title Case: 5 > -5
     28      */
     29     public void testN3() {
     30         T_if_le_1 t = new T_if_le_1();
     31         assertEquals(1234, t.run(5, -5));
     32     }
     33 
     34     /**
     35      * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE
     36      */
     37     public void testB1() {
     38         T_if_le_1 t = new T_if_le_1();
     39         assertEquals(1, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE));
     40     }
     41 
     42     /**
     43      * @title Arguments = Integer.MIN_VALUE, Integer.MAX_VALUE
     44      */
     45     public void testB2() {
     46         T_if_le_1 t = new T_if_le_1();
     47         assertEquals(1, t.run(Integer.MIN_VALUE, Integer.MAX_VALUE));
     48     }
     49 
     50     /**
     51      * @title Arguments = Integer.MAX_VALUE, Integer.MIN_VALUE
     52      */
     53     public void testB3() {
     54         T_if_le_1 t = new T_if_le_1();
     55         assertEquals(1234, t.run(Integer.MAX_VALUE, Integer.MIN_VALUE));
     56     }
     57 
     58     /**
     59      * @title Arguments = 0, Integer.MIN_VALUE
     60      */
     61     public void testB4() {
     62         T_if_le_1 t = new T_if_le_1();
     63         assertEquals(1234, t.run(0, Integer.MIN_VALUE));
     64     }
     65 
     66     /**
     67      * @title Arguments = 0, 0
     68      */
     69     public void testB5() {
     70         T_if_le_1 t = new T_if_le_1();
     71         assertEquals(1, t.run(0, 0));
     72     }
     73 
     74     /**
     75      * @constraint A23
     76      * @title number of registers
     77      */
     78     public void testVFE1() {
     79         load("dot.junit.opcodes.if_le.d.T_if_le_4", VerifyError.class);
     80     }
     81 
     82 
     83 
     84     /**
     85      * @constraint B1
     86      * @title  types of arguments - int, double
     87      */
     88     public void testVFE2() {
     89         load("dot.junit.opcodes.if_le.d.T_if_le_5", VerifyError.class);
     90     }
     91 
     92     /**
     93      * @constraint B1
     94      * @title  types of arguments - long, int
     95      */
     96     public void testVFE3() {
     97         load("dot.junit.opcodes.if_le.d.T_if_le_6", VerifyError.class);
     98     }
     99 
    100     /**
    101      * @constraint B1
    102      * @title types of arguments - int, reference
    103      */
    104     public void testVFE4() {
    105         load("dot.junit.opcodes.if_le.d.T_if_le_7", VerifyError.class);
    106     }
    107 
    108     /**
    109      * @constraint A6
    110      * @title  branch target shall be inside the method
    111      */
    112     public void testVFE5() {
    113         load("dot.junit.opcodes.if_le.d.T_if_le_9", VerifyError.class);
    114     }
    115 
    116     /**
    117      * @constraint A6
    118      * @title branch target shall not be "inside" instruction
    119      */
    120     public void testVFE6() {
    121         load("dot.junit.opcodes.if_le.d.T_if_le_10", VerifyError.class);
    122     }
    123 
    124     /**
    125      * @constraint n/a
    126      * @title branch target shall not be 0
    127      */
    128     public void testVFE7() {
    129         load("dot.junit.opcodes.if_le.d.T_if_le_12", VerifyError.class);
    130     }
    131 
    132     /**
    133      * @constraint B1
    134      * @title Types of arguments - int, float. The verifier checks that ints
    135      * and floats are not used interchangeably.
    136      */
    137     public void testVFE8() {
    138         load("dot.junit.opcodes.if_le.d.T_if_le_11", VerifyError.class);
    139     }
    140 }
    141