This is the mail archive of the mauve-discuss@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]

RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java


Greetings,

I think that the last 6 checks contained in Mauve test
"javax/swing/JTextArea/prefferedSize.java" should be changed. In the original
test, the preferred width of the JTextArea is compared with 100 pixels after
word line wrapping is enabled.

But it does not make sense (IMHO) because the JTextArea contains only empty text
or some NL characters ('\n'), which means, that preferred and minimum width of
JTextArea should be 0 pixels, not 100 in both cases because empty text and NL
sequence has only some non-zero height, but zero width. This behaviour is
independent of auto wrapping and/or word wrapping.

It's probably worth to add some check for preferred height.

Here is proposed change to this test:

--- preferredSize.java  2005-12-07 20:23:38.000000000 +0100
+++ prefferedsize.java  2011-09-02 16:02:00.000000000 +0200
@@ -51,14 +51,14 @@
         ta2.setLineWrap(true);
         ta2.setWrapStyleWord(true);

-        harness.check (ta2.getPreferredSize().width == 100);
-        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
+        harness.check (ta2.getPreferredSize().width == 0);
+        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
         ta2.setText("");
-        harness.check (ta2.getPreferredSize().width == 100);
-        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
+        harness.check (ta2.getPreferredSize().width == 0);
+        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
         ta2.setText("\n\n\n\n\n\n\n\n\n");
-        harness.check (ta2.getPreferredSize().width == 100);
-        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
+        harness.check (ta2.getPreferredSize().width == 0);
+        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
       }
     catch (Exception e)
       {
~

Is it possible to change this test case please?

Cheers,
Pavel


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