01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.drlvm.tests.regression.h4595;
19:
20: import junit.framework.*;
21:
22: public class Test extends TestCase {
23:
24: /// test 1
25: class A {
26: void in(long l1, long l2, long l3) {
27: assertEquals(10000002, l1);
28: }
29: }
30:
31: XGraphics2D g2d = new XGraphics2D();
32: A a = new A();
33:
34: public void test1() {
35: long l = get();
36: before(l);
37: a.in(g2d.display, g2d.drawable, g2d.imageGC);
38: }
39:
40: long get() {
41: return 4;
42: }
43:
44: void before(long l) { /*do nothing*/
45: }
46:
47: /// test 2
48: public void test2() {
49: long[] x = new long[] { g2d.drawable };
50: //check that no exception is thrown
51: }
52:
53: /// test 3
54:
55: double d = 30d;
56: static Test t = new Test();
57: static long[] arr = new long[] { 6, 25, 50 };
58:
59: public void test3() {
60: double v = t3();
61: assertEquals(v, 5d);
62: }
63:
64: double t3() {
65: double d1 = t.d / arr[0];
66: return d1;
67: }
68:
69: }
70:
71: class XGraphics2D {
72: long drawable = 10000001;
73: long display = 10000002;
74: long imageGC = 10000003;
75: }
|