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.dup_x2; 18 19 import dxc.junit.DxTestCase; 20 import dxc.junit.DxUtil; 21 import dxc.junit.opcodes.dup_x2.jm.T_dup_x2_1; 22 import dxc.junit.opcodes.dup_x2.jm.T_dup_x2_6; 23 import dxc.junit.opcodes.dup_x2.jm.T_dup_x2_7; 24 25 public class Test_dup_x2 extends DxTestCase { 26 27 /** 28 * @title type of argument - int, int, int 29 */ 30 public void testN1() { 31 T_dup_x2_1 t = new T_dup_x2_1(); 32 assertTrue(t.run()); 33 } 34 35 /** 36 * @title type of argument - float, float, float 37 */ 38 public void testN2() { 39 T_dup_x2_6 t = new T_dup_x2_6(); 40 assertTrue(t.run()); 41 } 42 43 /** 44 * @title type of argument - double, int 45 */ 46 public void testN3() { 47 T_dup_x2_7 t = new T_dup_x2_7(); 48 assertTrue(t.run()); 49 } 50 51 /** 52 * @constraint 4.8.2.1 53 * @title number of arguments 54 */ 55 public void testVFE1() { 56 try { 57 Class.forName("dxc.junit.opcodes.dup_x2.jm.T_dup_x2_2"); 58 fail("expected a verification exception"); 59 } catch (Throwable t) { 60 DxUtil.checkVerifyException(t); 61 } 62 } 63 64 /** 65 * @constraint 4.8.2.1 66 * @title type of argument - double 67 */ 68 public void testVFE2() { 69 try { 70 Class.forName("dxc.junit.opcodes.dup_x2.jm.T_dup_x2_3"); 71 fail("expected a verification exception"); 72 } catch (Throwable t) { 73 DxUtil.checkVerifyException(t); 74 } 75 } 76 77 /** 78 * @constraint 4.8.2.1 79 * @title type of argument - long 80 */ 81 public void testVFE3() { 82 try { 83 Class.forName("dxc.junit.opcodes.dup_x2.jm.T_dup_x2_4"); 84 fail("expected a verification exception"); 85 } catch (Throwable t) { 86 DxUtil.checkVerifyException(t); 87 } 88 } 89 90 /** 91 * @constraint 4.8.2.5 92 * @title stack size 93 */ 94 public void testVFE4() { 95 try { 96 Class.forName("dxc.junit.opcodes.dup_x2.jm.T_dup_x2_5"); 97 fail("expected a verification exception"); 98 } catch (Throwable t) { 99 DxUtil.checkVerifyException(t); 100 } 101 } 102 103 } 104