Home | History | Annotate | Download | only in dup2_x2
      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_x2;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_1;
     22 import dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_2;
     23 import dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_3;
     24 import dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_4;
     25 import dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_5;
     26 
     27 public class Test_dup2_x2 extends DxTestCase {
     28 
     29     /**
     30      * @title  type of argument - int, int, int, int
     31      */
     32     public void testN1() {
     33         T_dup2_x2_1 t = new T_dup2_x2_1();
     34         assertTrue(t.run());
     35     }
     36 
     37     /**
     38      * @title  type of argument - float, float, float, float
     39      */
     40     public void testN2() {
     41         T_dup2_x2_2 t = new T_dup2_x2_2();
     42         assertTrue(t.run());
     43     }
     44 
     45     /**
     46      * @title  type of argument - double, float, int
     47      */
     48     public void testN3() {
     49         T_dup2_x2_3 t = new T_dup2_x2_3();
     50         assertTrue(t.run());
     51     }
     52 
     53     /**
     54      * @title type of argument - int, float, long
     55      */
     56     public void testN4() {
     57         T_dup2_x2_4 t = new T_dup2_x2_4();
     58         assertTrue(t.run());
     59     }
     60 
     61     /**
     62      * @title type of argument - double, long
     63      */
     64     public void testN5() {
     65         T_dup2_x2_5 t = new T_dup2_x2_5();
     66         assertTrue(t.run());
     67     }
     68 
     69     /**
     70      * @constraint 4.8.2.1
     71      * @title number of arguments
     72      */
     73     public void testVFE1() {
     74         try {
     75             Class.forName("dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_6");
     76             fail("expected a verification exception");
     77         } catch (Throwable t) {
     78             DxUtil.checkVerifyException(t);
     79         }
     80     }
     81 
     82     /**
     83      * @constraint 4.8.2.5
     84      * @title stack size
     85      */
     86     public void testVFE4() {
     87         try {
     88             Class.forName("dxc.junit.opcodes.dup2_x2.jm.T_dup2_x2_7");
     89             fail("expected a verification exception");
     90         } catch (Throwable t) {
     91             DxUtil.checkVerifyException(t);
     92         }
     93     }
     94 
     95 }
     96