Home | History | Annotate | Download | only in lmul
      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.lmul;
     18 
     19 import dxc.junit.DxTestCase;
     20 import dxc.junit.DxUtil;
     21 import dxc.junit.opcodes.lmul.jm.T_lmul_1;
     22 
     23 public class Test_lmul extends DxTestCase {
     24 
     25     /**
     26      * @title Arguments = 222000000000l, 5000000000l
     27      */
     28     public void testN1() {
     29         T_lmul_1 t = new T_lmul_1();
     30         assertEquals(3195355577426903040l, t.run(222000000000l, 5000000000l));
     31     }
     32 
     33     /**
     34      * @title Arguments = -123456789l, 123456789l
     35      */
     36     public void testN2() {
     37         T_lmul_1 t = new T_lmul_1();
     38         assertEquals(-15241578750190521l, t.run(-123456789l, 123456789l));
     39     }
     40 
     41     /**
     42      * @title Arguments = -123456789l, -123456789l
     43      */
     44     public void testN3() {
     45         T_lmul_1 t = new T_lmul_1();
     46         assertEquals(15241578750190521l, t.run(-123456789l, -123456789l));
     47     }
     48 
     49     /**
     50      * @title Arguments = 0, Long.MAX_VALUE
     51      */
     52     public void testB1() {
     53         T_lmul_1 t = new T_lmul_1();
     54         assertEquals(0, t.run(0, Long.MAX_VALUE));
     55     }
     56     /**
     57      * @title Arguments = Long.MAX_VALUE, 1
     58      */
     59     public void testB2() {
     60         T_lmul_1 t = new T_lmul_1();
     61         assertEquals(9223372036854775807L, t.run(Long.MAX_VALUE, 1));
     62     }
     63     /**
     64      * @title Arguments = Long.MIN_VALUE, 1
     65      */
     66     public void testB3() {
     67         T_lmul_1 t = new T_lmul_1();
     68         assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, 1));
     69     }
     70     /**
     71      * @title Arguments = Long.MAX_VALUE, Long.MIN_VALUE
     72      */
     73     public void testB4() {
     74         T_lmul_1 t = new T_lmul_1();
     75         assertEquals(-9223372036854775808L, t.run(Long.MAX_VALUE,
     76                 Long.MIN_VALUE));
     77     }
     78     /**
     79      * @title Arguments = 0, 0
     80      */
     81     public void testB5() {
     82         T_lmul_1 t = new T_lmul_1();
     83         assertEquals(0, t.run(0, 0));
     84     }
     85     /**
     86      * @title Arguments = Long.MAX_VALUE, -1
     87      */
     88     public void testB6() {
     89         T_lmul_1 t = new T_lmul_1();
     90         assertEquals(-9223372036854775807L, t.run(Long.MAX_VALUE, -1));
     91     }
     92     /**
     93      * @title Arguments = Long.MIN_VALUE, -1
     94      */
     95     public void testB7() {
     96         T_lmul_1 t = new T_lmul_1();
     97         assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, -1));
     98     }
     99 
    100     /**
    101      * @constraint 4.8.2.1
    102      * @title number of arguments
    103      */
    104     public void testVFE1() {
    105         try {
    106             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_2");
    107             fail("expected a verification exception");
    108         } catch (Throwable t) {
    109             DxUtil.checkVerifyException(t);
    110         }
    111     }
    112 
    113     /**
    114      * @constraint 4.8.2.1
    115      * @title number of arguments
    116      */
    117     public void testVFE2() {
    118         try {
    119             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_3");
    120             fail("expected a verification exception");
    121         } catch (Throwable t) {
    122             DxUtil.checkVerifyException(t);
    123         }
    124     }
    125 
    126     /**
    127      * @constraint 4.8.2.1
    128      * @title types of arguments - long * double
    129      */
    130     public void testVFE3() {
    131         try {
    132             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_4");
    133             fail("expected a verification exception");
    134         } catch (Throwable t) {
    135             DxUtil.checkVerifyException(t);
    136         }
    137     }
    138 
    139     /**
    140      * @constraint 4.8.2.1
    141      * @title types of arguments - long * int
    142      */
    143     public void testVFE4() {
    144         try {
    145             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_5");
    146             fail("expected a verification exception");
    147         } catch (Throwable t) {
    148             DxUtil.checkVerifyException(t);
    149         }
    150     }
    151 
    152     /**
    153      * @constraint 4.8.2.1
    154      * @title types of arguments - float * long
    155      */
    156     public void testVFE5() {
    157         try {
    158             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_6");
    159             fail("expected a verification exception");
    160         } catch (Throwable t) {
    161             DxUtil.checkVerifyException(t);
    162         }
    163     }
    164 
    165     /**
    166      * @constraint 4.8.2.1
    167      * @title types of arguments - reference * long
    168      */
    169     public void testVFE6() {
    170         try {
    171             Class.forName("dxc.junit.opcodes.lmul.jm.T_lmul_7");
    172             fail("expected a verification exception");
    173         } catch (Throwable t) {
    174             DxUtil.checkVerifyException(t);
    175         }
    176     }
    177 }
    178