Home | History | Annotate | Download | only in astore_1
      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.astore_1;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.astore_1.jm.T_astore_1_1;
     22 import dxc.junit.opcodes.astore_1.jm.T_astore_1_5;
     23 
     24 public class Test_astore_1 extends DxTestCase {
     25 
     26     /**
     27      * @title value is stored
     28      */
     29     public void testN1() {
     30         assertEquals("hello", T_astore_1_1.run());
     31     }
     32 
     33     /**
     34      * @title equality of astore_<n> and astore <n>
     35      */
     36     public void testN2() {
     37         assertTrue(T_astore_1_5.run());
     38     }
     39 
     40     /**
     41      * @constraint 4.8.1.22
     42      * @title index must be no greater than the value
     43      * of max_locals-1
     44      */
     45     public void testVFE1() {
     46         try {
     47             Class.forName("dxc.junit.opcodes.astore_1.jm.T_astore_1_2");
     48             fail("expected a verification exception");
     49         } catch (Throwable t) {
     50             DxUtil.checkVerifyException(t);
     51         }
     52     }
     53 
     54     /**
     55      * @constraint 4.8.2.1
     56      * @title types of argument - float
     57      */
     58     public void testVFE2() {
     59         try {
     60             Class.forName("dxc.junit.opcodes.astore_1.jm.T_astore_1_3");
     61             fail("expected a verification exception");
     62         } catch (Throwable t) {
     63             DxUtil.checkVerifyException(t);
     64         }
     65     }
     66 
     67     /**
     68      * @constraint 4.8.2.1
     69      * @title types of argument - long
     70      */
     71     public void testVFE3() {
     72         try {
     73             Class.forName("dxc.junit.opcodes.astore_1.jm.T_astore_1_4");
     74             fail("expected a verification exception");
     75         } catch (Throwable t) {
     76             DxUtil.checkVerifyException(t);
     77         }
     78     }
     79 }
     80