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