Home | History | Annotate | Download | only in or_int_lit16
      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 dot.junit.opcodes.or_int_lit16;
     18 
     19 import dot.junit.DxTestCase;
     20 import dot.junit.DxUtil;
     21 import dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_1;
     22 import dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_2;
     23 import dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_3;
     24 import dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_4;
     25 import dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_5;
     26 
     27 public class Test_or_int_lit16 extends DxTestCase {
     28 
     29     /**
     30      * @title Arguments = 15, 8
     31      */
     32     public void testN1() {
     33         T_or_int_lit16_1 t = new T_or_int_lit16_1();
     34         assertEquals(15, t.run(15));
     35     }
     36 
     37     /**
     38      * @title Arguments = 0x5ff5, 0x7ff7
     39      */
     40     public void testN2() {
     41         T_or_int_lit16_2 t = new T_or_int_lit16_2();
     42         assertEquals(0x7ff7, t.run(0x5ff5));
     43     }
     44 
     45     /**
     46      * @title Arguments = 0xcafe & -1
     47      */
     48     public void testN3() {
     49         T_or_int_lit16_3 t = new T_or_int_lit16_3();
     50         assertEquals(-1, t.run(0xcaf));
     51     }
     52 
     53     /**
     54      * @title Arguments = 0 & -1
     55      */
     56     public void testB1() {
     57         T_or_int_lit16_3 t = new T_or_int_lit16_3();
     58         assertEquals(-1, t.run(0));
     59     }
     60 
     61     /**
     62      * @title Arguments = Short.MAX_VALUE & Short.MIN_VALUE
     63      */
     64     public void testB2() {
     65         T_or_int_lit16_5 t = new T_or_int_lit16_5();
     66         assertEquals(0xffffffff, t.run(Short.MIN_VALUE));
     67     }
     68 
     69     /**
     70      * @constraint A23
     71      * @title number of registers
     72      */
     73     public void testVFE1() {
     74         load("dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_6", VerifyError.class);
     75     }
     76 
     77 
     78 
     79     /**
     80      * @constraint B1
     81      * @title types of arguments - double & int
     82      */
     83     public void testVFE2() {
     84         load("dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_7", VerifyError.class);
     85     }
     86 
     87     /**
     88      * @constraint B1
     89      * @title types of arguments - long & int
     90      */
     91     public void testVFE3() {
     92         load("dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_8", VerifyError.class);
     93     }
     94 
     95     /**
     96      * @constraint B1
     97      * @title types of arguments - reference & int
     98      */
     99     public void testVFE4() {
    100         load("dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_9", VerifyError.class);
    101     }
    102 
    103     /**
    104      * @constraint B1
    105      * @title Types of arguments - float, int. The verifier checks that ints
    106      * and floats are not used interchangeably.
    107      */
    108     public void testVFE5() {
    109         load("dot.junit.opcodes.or_int_lit16.d.T_or_int_lit16_4", VerifyError.class);
    110     }
    111 }
    112