Home | History | Annotate | Download | only in lstore
      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.lstore;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.lstore.jm.T_lstore_1;
     22 import dxc.junit.opcodes.lstore.jm.T_lstore_1_w;
     23 import dxc.junit.opcodes.lstore.jm.T_lstore_2;
     24 import dxc.junit.opcodes.lstore.jm.T_lstore_2_w;
     25 
     26 public class Test_lstore extends DxTestCase {
     27 
     28     /*
     29      * NORMAL ISTORE VERSION
     30      */
     31 
     32     /**
     33      * @title  lstore 0
     34      */
     35     public void testN1() {
     36         assertEquals(1234567890123l, T_lstore_1.run());
     37     }
     38 
     39     /**
     40      * @title  lstore 255
     41      */
     42     public void testN2() {
     43         assertEquals(1234567890123l, T_lstore_2.run());
     44     }
     45 
     46     /**
     47      * @constraint 4.8.1.22
     48      * @title index must be no greater than the value
     49      * of max_locals-1
     50      */
     51     public void testVFE1() {
     52         try {
     53             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_3");
     54             fail("expected a verification exception");
     55         } catch (Throwable t) {
     56             DxUtil.checkVerifyException(t);
     57         }
     58     }
     59 
     60     /**
     61      * @constraint 4.8.2.1
     62      * @title types of argument - double
     63      */
     64     public void testVFE2() {
     65         try {
     66             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_4");
     67             fail("expected a verification exception");
     68         } catch (Throwable t) {
     69             DxUtil.checkVerifyException(t);
     70         }
     71     }
     72 
     73     /**
     74      * @constraint 4.8.2.1
     75      * @title types of argument - int
     76      */
     77     public void testVFE3() {
     78         try {
     79             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_5");
     80             fail("expected a verification exception");
     81         } catch (Throwable t) {
     82             DxUtil.checkVerifyException(t);
     83         }
     84     }
     85 
     86     /**
     87      * @constraint 4.8.2.1
     88      * @title types of argument - float
     89      */
     90     public void testVFE4() {
     91         try {
     92             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_6");
     93             fail("expected a verification exception");
     94         } catch (Throwable t) {
     95             DxUtil.checkVerifyException(t);
     96         }
     97     }
     98 
     99     /*
    100      * WIDE ISTORE VERSION
    101      */
    102 
    103     /**
    104      * @title  lstore_w 0
    105      */
    106     public void testN3() {
    107         assertEquals(1234567890123l, T_lstore_1_w.run());
    108     }
    109 
    110     /**
    111      * @title  lstore 257
    112      */
    113     public void testN4() {
    114         assertEquals(1234567890123l, T_lstore_2_w.run());
    115     }
    116 
    117     /**
    118      * @constraint 4.8.1.25
    119      * @title index must be no greater than the value
    120      * of max_locals-1
    121      */
    122     public void testVFE5() {
    123         try {
    124             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_3_w");
    125             fail("expected a verification exception");
    126         } catch (Throwable t) {
    127             DxUtil.checkVerifyException(t);
    128         }
    129     }
    130 
    131     /**
    132      * @constraint 4.8.2.1
    133      * @title types of argument - double
    134      */
    135     public void testVFE6() {
    136         try {
    137             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_4_w");
    138             fail("expected a verification exception");
    139         } catch (Throwable t) {
    140             DxUtil.checkVerifyException(t);
    141         }
    142     }
    143 
    144     /**
    145      * @constraint 4.8.2.1
    146      * @title types of argument - int
    147      */
    148     public void testVFE7() {
    149         try {
    150             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_5_w");
    151             fail("expected a verification exception");
    152         } catch (Throwable t) {
    153             DxUtil.checkVerifyException(t);
    154         }
    155     }
    156 
    157     /**
    158      * @constraint 4.8.2.1
    159      * @title types of argument - float
    160      */
    161     public void testVFE8() {
    162         try {
    163             Class.forName("dxc.junit.opcodes.lstore.jm.T_lstore_6_w");
    164             fail("expected a verification exception");
    165         } catch (Throwable t) {
    166             DxUtil.checkVerifyException(t);
    167         }
    168     }
    169 
    170 }
    171