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