Home | History | Annotate | Download | only in dup2
      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.dup2;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.dup2.jm.T_dup2_1;
     22 import dxc.junit.opcodes.dup2.jm.T_dup2_3;
     23 import dxc.junit.opcodes.dup2.jm.T_dup2_4;
     24 import dxc.junit.opcodes.dup2.jm.T_dup2_6;
     25 
     26 public class Test_dup2 extends DxTestCase {
     27 
     28     /**
     29      * @title  type of argument - int, int
     30      */
     31     public void testN1() {
     32         T_dup2_1 t = new T_dup2_1();
     33         assertTrue(t.run());
     34     }
     35 
     36     /**
     37      * @title  type of argument - float, float
     38      */
     39     public void testN2() {
     40         T_dup2_6 t = new T_dup2_6();
     41         assertTrue(t.run());
     42     }
     43 
     44     /**
     45      * @title  type of argument - double, int
     46      */
     47     public void testN3() {
     48         T_dup2_3 t = new T_dup2_3();
     49         assertTrue(t.run());
     50     }
     51 
     52     /**
     53      * @title  type of argument - long, int
     54      */
     55     public void testN4() {
     56         T_dup2_4 t = new T_dup2_4();
     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.dup2.jm.T_dup2_2");
     67             fail("expected a verification exception");
     68         } catch (Throwable t) {
     69             DxUtil.checkVerifyException(t);
     70         }
     71     }
     72 
     73     /**
     74      * @constraint 4.8.2.5
     75      * @title stack size
     76      */
     77     public void testVFE4() {
     78         try {
     79             Class.forName("dxc.junit.opcodes.dup2.jm.T_dup2_5");
     80             fail("expected a verification exception");
     81         } catch (Throwable t) {
     82             DxUtil.checkVerifyException(t);
     83         }
     84     }
     85 
     86 }
     87