OSDN Git Service

AI 144830: Bringing luni down to 15 broken tests. Not perfect,
[android-x86/dalvik.git] / libcore / luni / src / test / java / tests / api / java / util / HashMapTest.java
index 6a0b8e2..1d726ea 100644 (file)
@@ -60,18 +60,10 @@ public class HashMapTest extends junit.framework.TestCase {
 
     final static int hmSize = 1000;
 
-    static Object[] objArray;
-
-    static Object[] objArray2;
-    {
-        objArray = new Object[hmSize];
-        objArray2 = new Object[hmSize];
-        for (int i = 0; i < objArray.length; i++) {
-            objArray[i] = new Integer(i);
-            objArray2[i] = objArray[i].toString();
-        }
-    }
+    Object[] objArray;
 
+    Object[] objArray2;
+    
     /**
      * @tests java.util.HashMap#HashMap()
      */
@@ -624,6 +616,13 @@ public class HashMapTest extends junit.framework.TestCase {
      * is called before a test is executed.
      */
     protected void setUp() {
+        objArray = new Object[hmSize];
+        objArray2 = new Object[hmSize];
+        for (int i = 0; i < objArray.length; i++) {
+            objArray[i] = new Integer(i);
+            objArray2[i] = objArray[i].toString();
+        }
+
         hm = new HashMap();
         for (int i = 0; i < objArray.length; i++)
             hm.put(objArray2[i], objArray[i]);
@@ -636,5 +635,8 @@ public class HashMapTest extends junit.framework.TestCase {
      * method is called after a test is executed.
      */
     protected void tearDown() {
+        hm = null;
+        objArray = null;
+        objArray2 = null;
     }
 }