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.dconst_1; 18 19 import dxc.junit.DxTestCase; 20 import dxc.junit.DxUtil; 21 import dxc.junit.opcodes.dconst_1.jm.T_dconst_1_1; 22 23 public class Test_dconst_1 extends DxTestCase { 24 25 /** 26 * @title normal test 27 */ 28 public void testN1() { 29 T_dconst_1_1 t = new T_dconst_1_1(); 30 double b = 1235d; 31 double c = 1234d; 32 double d = b - c; 33 assertEquals(d, t.run()); 34 } 35 36 /** 37 * @constraint 4.8.2.5 38 * @title stack size 39 */ 40 public void testVFE1() { 41 try { 42 Class.forName("dxc.junit.opcodes.dconst_1.jm.T_dconst_1_2"); 43 fail("expected a verification exception"); 44 } catch (Throwable t) { 45 DxUtil.checkVerifyException(t); 46 } 47 } 48 } 49