Author: allain.lalonde
Date: Fri Jul 17 17:39:55 2009
New Revision: 499

Modified:
     
piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/pswing/PSwingCanvasTest.java

Log:
Changed test name since it was incorrectly referring to PCanvas

Modified:  
piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/pswing/PSwingCanvasTest.java
==============================================================================
---  
piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/pswing/PSwingCanvasTest.java
       
(original)
+++  
piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/pswing/PSwingCanvasTest.java
       
Fri Jul 17 17:39:55 2009
@@ -2,29 +2,29 @@

  import javax.swing.JPanel;

-import edu.umd.cs.piccolo.PCanvas;
  import junit.framework.TestCase;

  public class PSwingCanvasTest extends TestCase {
-    protected int pCanvasFinalizerCount;
+    protected int finalizerCallCount;

-    public void testMemoryLeakWithPCanvas() throws InterruptedException {
-        JPanel panel = new JPanel();
-        for (int i=0; i < 10; i++) {
+    public void testMemoryLeak() throws InterruptedException {
+        JPanel panel = new JPanel();
+        for (int i = 0; i < 10; i++) {
              PSwingCanvas canvas = new PSwingCanvas() {
                  public void finalize() {
-                    pCanvasFinalizerCount ++;
+                    finalizerCallCount++;
                  }
              };
              panel.add(canvas);
-            panel.remove(canvas);
+            panel.remove(canvas);
              canvas = null;
          }
-
+        panel = null;
          System.gc();
          System.runFinalization();
-
-        // Not sure why I need -1 here, but I do. If I create 10000 it'll  
always be 1 less
-        assertEquals(10-1, pCanvasFinalizerCount);
+
+        // Not sure why I need -1 here, but I do. If I create 10000 it'll  
always
+        // be 1 less
+        assertEquals(10 - 1, finalizerCallCount);
      }
  }

--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to