• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package dot.junit.opcodes.if_ge;
2 
3 import dot.junit.DxTestCase;
4 import dot.junit.DxUtil;
5 import dot.junit.opcodes.if_ge.d.T_if_ge_1;
6 import dot.junit.opcodes.if_ge.d.T_if_ge_3;
7 
8 public class Test_if_ge extends DxTestCase {
9 
10     /**
11      * @title Case: 5 < 6
12      */
testN1()13     public void testN1() {
14         T_if_ge_1 t = new T_if_ge_1();
15         assertEquals(1234, t.run(5, 6));
16     }
17 
18     /**
19      * @title Case: 0x0f0e0d0c = 0x0f0e0d0c
20      */
testN2()21     public void testN2() {
22         T_if_ge_1 t = new T_if_ge_1();
23         assertEquals(1, t.run(0x0f0e0d0c, 0x0f0e0d0c));
24     }
25 
26     /**
27      * @title Case: 5 > -5
28      */
testN3()29     public void testN3() {
30         T_if_ge_1 t = new T_if_ge_1();
31         assertEquals(1, 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_ge_1 t = new T_if_ge_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      */
testB2()45     public void testB2() {
46         T_if_ge_1 t = new T_if_ge_1();
47         assertEquals(1234, 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_ge_1 t = new T_if_ge_1();
55         assertEquals(1, 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_ge_1 t = new T_if_ge_1();
63         assertEquals(1, t.run(0, Integer.MIN_VALUE));
64     }
65 
66     /**
67      * @title Arguments = 0, 0
68      */
testB5()69     public void testB5() {
70         T_if_ge_1 t = new T_if_ge_1();
71         assertEquals(1, 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_ge.d.T_if_ge_4", VerifyError.class);
80     }
81 
82 
83 
84     /**
85      * @constraint B1
86      * @title  types of arguments - int, double
87      */
testVFE2()88     public void testVFE2() {
89         load("dot.junit.opcodes.if_ge.d.T_if_ge_5", VerifyError.class);
90     }
91 
92     /**
93      * @constraint B1
94      * @title  types of arguments - long, int
95      */
testVFE3()96     public void testVFE3() {
97         load("dot.junit.opcodes.if_ge.d.T_if_ge_6", VerifyError.class);
98     }
99 
100     /**
101      * @constraint B1
102      * @title  types of arguments - int, reference
103      */
testVFE4()104     public void testVFE4() {
105         load("dot.junit.opcodes.if_ge.d.T_if_ge_7", VerifyError.class);
106     }
107 
108     /**
109      * @constraint B1
110      * @title Types of arguments - int, float. The verifier checks that ints
111      * and floats are not used interchangeably.
112      */
testVFE5()113     public void testVFE5() {
114         load("dot.junit.opcodes.if_ge.d.T_if_ge_3", VerifyError.class);
115     }
116 
117      /**
118      * @constraint A6
119      * @title  branch target shall be inside the method
120      */
testVFE6()121     public void testVFE6() {
122         load("dot.junit.opcodes.if_ge.d.T_if_ge_9", VerifyError.class);
123     }
124 
125     /**
126      * @constraint A6
127      * @title  branch target shall not be "inside" instruction
128      */
testVFE7()129     public void testVFE7() {
130         load("dot.junit.opcodes.if_ge.d.T_if_ge_10", VerifyError.class);
131     }
132 
133     /**
134      * @constraint n/a
135      * @title  branch target shall 0
136      */
testVFE8()137     public void testVFE8() {
138         load("dot.junit.opcodes.if_ge.d.T_if_ge_11", VerifyError.class);
139     }
140 
141 }
142