Home | History | Annotate | Download | only in bipush
      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.bipush;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.bipush.jm.T_bipush_1;
     22 import dxc.junit.opcodes.bipush.jm.T_bipush_2;
     23 import dxc.junit.opcodes.bipush.jm.T_bipush_3;
     24 
     25 public class Test_bipush extends DxTestCase {
     26 
     27     /**
     28      * @title normal test
     29      */
     30     public void testN1() {
     31         T_bipush_1 t = new T_bipush_1();
     32         assertEquals(100, t.run());
     33     }
     34 
     35     /**
     36      * @title normal test
     37      */
     38     public void testB1() {
     39         T_bipush_2 t = new T_bipush_2();
     40         assertEquals(0, t.run());
     41     }
     42 
     43     /**
     44      * @title normal test
     45      */
     46     public void testB2() {
     47         T_bipush_3 t = new T_bipush_3();
     48         assertEquals(-1, t.run());
     49     }
     50 
     51     /**
     52      * @constraint 4.8.2.5
     53      * @title stack size
     54      */
     55     public void testVFE1() {
     56         try {
     57             Class.forName("dxc.junit.opcodes.bipush.jm.T_bipush_4");
     58             fail("expected a verification exception");
     59         } catch (Throwable t) {
     60             DxUtil.checkVerifyException(t);
     61         }
     62     }
     63 
     64 }
     65