This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: ViewportLayout test fixlet


I fixed the ViewportLayout tests to check against absolute Dimension
values instead of some properties from components. The tests previously
yielded a false positive because of a JComponent.getPreferredSize() bug.
It accidentally modified the preferredSize of the view and then checked
against this modified value instead of the correct value.

2005-12-15  Roman Kennke  <kennke@aicas.com>

        * gnu/testlet/javax/swing/ViewportLayout/layoutContainer.java
        Made tests more safe from sideeffects by using absolute Dimension
        values instead of some size properties.

/Roman
Index: gnu/testlet/javax/swing/ViewportLayout/layoutContainer.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/ViewportLayout/layoutContainer.java,v
retrieving revision 1.1
diff -u -r1.1 layoutContainer.java
--- gnu/testlet/javax/swing/ViewportLayout/layoutContainer.java	12 Dec 2005 13:01:27 -0000	1.1
+++ gnu/testlet/javax/swing/ViewportLayout/layoutContainer.java	15 Dec 2005 17:53:06 -0000
@@ -66,7 +66,7 @@
     view.setMaximumSize(new Dimension(300, 300));
     vp.setSize(400, 400);
     layout.layoutContainer(vp);
-    h.check(view.getSize(), vp.getSize());
+    h.check(view.getSize(), new Dimension(400, 400));
   }
 
   /**
@@ -85,7 +85,7 @@
     view.setMaximumSize(new Dimension(300, 300));
     vp.setSize(150, 150);
     layout.layoutContainer(vp);
-    h.check(view.getSize(), view.getPreferredSize());
+    h.check(view.getSize(), new Dimension(200, 200));
   }
 
   /**
@@ -104,6 +104,6 @@
     view.setMaximumSize(new Dimension(300, 300));
     vp.setSize(50, 50);
     layout.layoutContainer(vp);
-    h.check(view.getSize(), vp.getSize());
+    h.check(view.getSize(), new Dimension(50, 50));
   }
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]