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.lor; 18 19 import dxc.junit.DxTestCase; 20 import dxc.junit.DxUtil; 21 import dxc.junit.opcodes.lor.jm.T_lor_1; 22 23 public class Test_lor extends DxTestCase { 24 25 /** 26 * @title Arguments = 123456789121l, 2l 27 */ 28 public void testN1() { 29 T_lor_1 t = new T_lor_1(); 30 assertEquals(123456789123l, t.run(123456789121l, 2l)); 31 } 32 33 /** 34 * @title Arguments = 0xffffffffffffff8l, 0xffffffffffffff1l 35 */ 36 public void testN2() { 37 T_lor_1 t = new T_lor_1(); 38 assertEquals(0xffffffffffffff9l, t.run(0xffffffffffffff8l, 39 0xffffffffffffff1l)); 40 } 41 42 /** 43 * @title Arguments = 0xabcdefabcdef, -1 44 */ 45 public void testN3() { 46 T_lor_1 t = new T_lor_1(); 47 assertEquals(-1l, t.run(0xabcdefabcdefl, -1l)); 48 } 49 50 /** 51 * @title Arguments = 0, -1 52 */ 53 public void testB1() { 54 T_lor_1 t = new T_lor_1(); 55 assertEquals(-1l, t.run(0l, -1l)); 56 } 57 58 /** 59 * @title Arguments = Long.MAX_VALUE, Long.MIN_VALUE 60 */ 61 public void testB2() { 62 T_lor_1 t = new T_lor_1(); 63 assertEquals(-1l, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); 64 } 65 66 /** 67 * @constraint 4.8.2.1 68 * @title number of arguments 69 */ 70 public void testVFE1() { 71 try { 72 Class.forName("dxc.junit.opcodes.lor.jm.T_lor_2"); 73 fail("expected a verification exception"); 74 } catch (Throwable t) { 75 DxUtil.checkVerifyException(t); 76 } 77 } 78 79 /** 80 * @constraint 4.8.2.1 81 * @title types of arguments - double & long 82 */ 83 public void testVFE2() { 84 try { 85 Class.forName("dxc.junit.opcodes.lor.jm.T_lor_3"); 86 fail("expected a verification exception"); 87 } catch (Throwable t) { 88 DxUtil.checkVerifyException(t); 89 } 90 } 91 92 /** 93 * @constraint 4.8.2.1 94 * @title types of arguments - int & long 95 */ 96 public void testVFE3() { 97 try { 98 Class.forName("dxc.junit.opcodes.lor.jm.T_lor_4"); 99 fail("expected a verification exception"); 100 } catch (Throwable t) { 101 DxUtil.checkVerifyException(t); 102 } 103 } 104 105 /** 106 * @constraint 4.8.2.1 107 * @title types of arguments - float & long 108 */ 109 public void testVFE4() { 110 try { 111 Class.forName("dxc.junit.opcodes.lor.jm.T_lor_5"); 112 fail("expected a verification exception"); 113 } catch (Throwable t) { 114 DxUtil.checkVerifyException(t); 115 } 116 } 117 118 /** 119 * @constraint 4.8.2.1 120 * @title types of arguments - reference & long 121 */ 122 public void testVFE5() { 123 try { 124 Class.forName("dxc.junit.opcodes.lor.jm.T_lor_6"); 125 fail("expected a verification exception"); 126 } catch (Throwable t) { 127 DxUtil.checkVerifyException(t); 128 } 129 } 130 131 } 132