• 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 dxc.junit.opcodes.sipush;
18 
19 import dxc.junit.DxTestCase;
20 import dxc.junit.DxUtil;
21 import dxc.junit.opcodes.sipush.jm.T_sipush_1;
22 import dxc.junit.opcodes.sipush.jm.T_sipush_2;
23 import dxc.junit.opcodes.sipush.jm.T_sipush_3;
24 
25 public class Test_sipush extends DxTestCase {
26 
27     /**
28      * @title sipush -13570
29      */
testN1()30     public void testN1() {
31         T_sipush_1 t = new T_sipush_1();
32         assertEquals(-13570, t.run());
33     }
34 
35     /**
36      * @title sipush 0
37      */
testB1()38     public void testB1() {
39         T_sipush_2 t = new T_sipush_2();
40         assertEquals(0, t.run());
41     }
42 
43     /**
44      * @title sipush - 1
45      */
testB2()46     public void testB2() {
47         T_sipush_3 t = new T_sipush_3();
48         assertEquals(-1, t.run());
49     }
50 
51     /**
52      * @constraint 4.8.2.5
53      * @title stack size
54      */
testVFE1()55     public void testVFE1() {
56         try {
57             Class.forName("dxc.junit.opcodes.sipush.jm.T_sipush_4");
58             fail("expected a verification exception");
59         } catch (Throwable t) {
60             DxUtil.checkVerifyException(t);
61         }
62     }
63 
64 }
65