• 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.pop2;
18 
19 import dxc.junit.DxTestCase;
20 import dxc.junit.DxUtil;
21 import dxc.junit.opcodes.pop2.jm.T_pop2_1;
22 import dxc.junit.opcodes.pop2.jm.T_pop2_2;
23 
24 public class Test_pop2 extends DxTestCase {
25 
26     /**
27      * @title  type of argument - long
28      */
testN1()29     public void testN1() {
30         T_pop2_1 t = new T_pop2_1();
31         assertEquals(1234l, t.run());
32     }
33 
34     /**
35      * @title  type of argument - double
36      */
testN2()37     public void testN2() {
38         T_pop2_2 t = new T_pop2_2();
39         assertEquals(1234d, t.run());
40     }
41 
42     /**
43      * @constraint 4.8.2.1
44      * @title number of arguments
45      */
testVFE1()46     public void testVFE1() {
47         try {
48             Class.forName("dxc.junit.opcodes.pop2.jm.T_pop2_3");
49             fail("expected a verification exception");
50         } catch (Throwable t) {
51             DxUtil.checkVerifyException(t);
52         }
53     }
54 
55     /**
56      * @constraint 4.8.2.1
57      * @title type of argument - int
58      */
testVFE2()59     public void testVFE2() {
60         try {
61             Class.forName("dxc.junit.opcodes.pop2.jm.T_pop2_4");
62             fail("expected a verification exception");
63         } catch (Throwable t) {
64             DxUtil.checkVerifyException(t);
65         }
66     }
67 
68 }
69