You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ch...@apache.org on 2009/01/08 16:39:46 UTC
svn commit: r732726 - in
/harmony/enhanced/drlvm/trunk/src/test/regression/H6020: ./
CircularClassInitTest.java run.test.xml
Author: chunrong
Date: Thu Jan 8 07:39:46 2009
New Revision: 732726
URL: http://svn.apache.org/viewvc?rev=732726&view=rev
Log:
Add regression test for HARMONY-6020
Added:
harmony/enhanced/drlvm/trunk/src/test/regression/H6020/
harmony/enhanced/drlvm/trunk/src/test/regression/H6020/CircularClassInitTest.java
harmony/enhanced/drlvm/trunk/src/test/regression/H6020/run.test.xml
Added: harmony/enhanced/drlvm/trunk/src/test/regression/H6020/CircularClassInitTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H6020/CircularClassInitTest.java?rev=732726&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H6020/CircularClassInitTest.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H6020/CircularClassInitTest.java Thu Jan 8 07:39:46 2009
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.drlvm.tests.regression.h6020;
+
+import junit.framework.TestCase;
+
+public class CircularClassInitTest extends TestCase{
+ public static void main(String[] args) {
+ CircularClassInitTest.testObject();
+ CircularClassInitTest.testArray();
+ System.out.println("PASSED");
+ }
+
+ public static void testObject() {
+ Child_ObjectCase c = Parent_ObjectCase.createChild();
+ if(c.ROOT != null) {
+ fail();
+ }
+ }
+
+ public static void testArray() {
+ Child_ArrayCase c = Parent_ArrayCase.createChild();
+ }
+}
+
+class Parent_ObjectCase {
+ private static final Child_ObjectCase childCache = new Child_ObjectCase();
+
+ public static Child_ObjectCase createChild(){
+ return childCache;
+ }
+}
+
+class Child_ObjectCase {
+ public static final Child_ObjectCase ROOT = Parent_ObjectCase.createChild();
+}
+
+class Parent_ArrayCase {
+ private static final Child_ArrayCase[] childCache = new Child_ArrayCase[5];
+
+ public static Child_ArrayCase createChild(){
+ return childCache[0];
+ }
+}
+
+class Child_ArrayCase {
+ public static final Child_ArrayCase ROOT = Parent_ArrayCase.createChild();
+}
+
Added: harmony/enhanced/drlvm/trunk/src/test/regression/H6020/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H6020/run.test.xml?rev=732726&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H6020/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H6020/run.test.xml Thu Jan 8 07:39:46 2009
@@ -0,0 +1,33 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+
+<project name="RUN HARMONY-6020 Regression Test">
+ <target name="run-test">
+ <run-junit-test
+ test="org.apache.harmony.drlvm.tests.regression.h6020.CircularClassInitTest"
+ vmarg="-Xem:jet">
+ </run-junit-test>
+ <!--run-junit-test
+ test="org.apache.harmony.drlvm.tests.regression.h6020.CircularClassInitTest"
+ vmarg="-Xint">
+ </run-junit-test-->
+ <run-junit-test
+ test="org.apache.harmony.drlvm.tests.regression.h6020.CircularClassInitTest"
+ vmarg="-Xem:opt">
+ </run-junit-test>
+ </target>
+</project>
+