• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package dot.junit.opcodes.move_result;
18 
19 import dot.junit.DxTestCase;
20 import dot.junit.DxUtil;
21 import dot.junit.opcodes.move_result.d.T_move_result_1;
22 
23 public class Test_move_result extends DxTestCase {
24     /**
25      * @title tests move-result functionality
26      */
testN1()27     public void testN1() {
28         assertTrue(T_move_result_1.run());
29     }
30 
31 
32     /**
33      * @constraint A23
34      * @title number of registers - dest is not valid
35      */
testVFE1()36     public void testVFE1() {
37         try {
38             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_2");
39             fail("expected a verification exception");
40         } catch (Throwable t) {
41             DxUtil.checkVerifyException(t);
42         }
43     }
44 
45 
46     /**
47      * @constraint B1
48      * @title  reference
49      */
testVFE2()50     public void testVFE2() {
51         try {
52             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_3");
53             fail("expected a verification exception");
54         } catch (Throwable t) {
55             DxUtil.checkVerifyException(t);
56         }
57     }
58 
59     /**
60      * @constraint B1
61      * @title wide
62      */
testVFE3()63     public void testVFE3() {
64         try {
65             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_4");
66             fail("expected a verification exception");
67         } catch (Throwable t) {
68             DxUtil.checkVerifyException(t);
69         }
70     }
71 
72 
73     /**
74      * @constraint B18
75      * @title When writing to a register that is one half of a
76      * register pair, but not touching the other half, the old register pair gets broken
77      * up, and the other register involved in it becomes undefined.
78      */
testVFE4()79     public void testVFE4() {
80         try {
81             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_5");
82             fail("expected a verification exception");
83         } catch (Throwable t) {
84             DxUtil.checkVerifyException(t);
85         }
86     }
87 
88     /**
89      * @constraint B19
90      * @title  move-result instruction must be immediately preceded
91      * (in the insns array) by an <invoke-kind> instruction
92      */
testVFE5()93     public void testVFE5() {
94         try {
95             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_6");
96             fail("expected a verification exception");
97         } catch (Throwable t) {
98             DxUtil.checkVerifyException(t);
99         }
100     }
101 
102     /**
103      * @constraint B20
104      * @title move-result instruction must be immediately preceded
105      * (in actual control flow) by an <invoke-kind> instruction
106      */
testVFE6()107     public void testVFE6() {
108         try {
109             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_7");
110             fail("expected a verification exception");
111         } catch (Throwable t) {
112             DxUtil.checkVerifyException(t);
113         }
114     }
115 
116     /**
117      * @constraint A23
118      * @title number of registers
119      */
testVFE7()120     public void testVFE7() {
121         try {
122             Class.forName("dot.junit.opcodes.move_result.d.T_move_result_8");
123             fail("expected a verification exception");
124         } catch (Throwable t) {
125             DxUtil.checkVerifyException(t);
126         }
127     }
128 }
129