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