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