public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
* RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
@ 2011-09-02 14:15 Pavel Tisnovsky
  2011-09-02 15:03 ` Dr Andrew John Hughes
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Tisnovsky @ 2011-09-02 14:15 UTC (permalink / raw)
  To: mauve-discuss

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-02 14:15 RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java Pavel Tisnovsky
@ 2011-09-02 15:03 ` Dr Andrew John Hughes
  2011-09-02 15:07   ` Pavel Tisnovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Dr Andrew John Hughes @ 2011-09-02 15:03 UTC (permalink / raw)
  To: Pavel Tisnovsky; +Cc: mauve-discuss

On 16:17 Fri 02 Sep     , Pavel Tisnovsky wrote:
> 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

Do tests still pass with these changes?
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-02 15:03 ` Dr Andrew John Hughes
@ 2011-09-02 15:07   ` Pavel Tisnovsky
  2011-09-07  2:39     ` Dr Andrew John Hughes
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Tisnovsky @ 2011-09-02 15:07 UTC (permalink / raw)
  To: Dr Andrew John Hughes; +Cc: mauve-discuss

Dr Andrew John Hughes wrote:
> On 16:17 Fri 02 Sep     , Pavel Tisnovsky wrote:
>> 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
> 
> Do tests still pass with these changes?

yes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-02 15:07   ` Pavel Tisnovsky
@ 2011-09-07  2:39     ` Dr Andrew John Hughes
  2011-09-07 11:34       ` Pavel Tisnovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Dr Andrew John Hughes @ 2011-09-07  2:39 UTC (permalink / raw)
  To: Pavel Tisnovsky; +Cc: mauve-discuss

On 17:09 Fri 02 Sep     , Pavel Tisnovsky wrote:
> Dr Andrew John Hughes wrote:
> > On 16:17 Fri 02 Sep     , Pavel Tisnovsky wrote:
> >> 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
> > 
> > Do tests still pass with these changes?
> 
> yes

On both OpenJDK and GNU Classpath?
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-07  2:39     ` Dr Andrew John Hughes
@ 2011-09-07 11:34       ` Pavel Tisnovsky
  2011-09-07 15:35         ` Dr Andrew John Hughes
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Tisnovsky @ 2011-09-07 11:34 UTC (permalink / raw)
  To: Dr Andrew John Hughes; +Cc: mauve-discuss

Dr Andrew John Hughes wrote:
> On 17:09 Fri 02 Sep     , Pavel Tisnovsky wrote:
>> Dr Andrew John Hughes wrote:
>>> On 16:17 Fri 02 Sep     , Pavel Tisnovsky wrote:
>>>> 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
>>> Do tests still pass with these changes?
>> yes
> 
> On both OpenJDK and GNU Classpath?

They pass only on OpenJDK. On GNU Classpath (4.4.4), some tests failed
regardless of whether the patch has been applied or not. But the failures
occurred on previous test not touched by the patch:

        ta2.setText("");
        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 == 0);
        harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);

before the line wrap & word wrap is enabled.

The proposed patch fixes other failures on OpenJDK & GNU Classpath too, ie:
OpenJDK:       6 failures -> 0 failures
GNU Classpath: 8 failures -> 2 failures

Pavel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-07 11:34       ` Pavel Tisnovsky
@ 2011-09-07 15:35         ` Dr Andrew John Hughes
  2011-09-12  9:13           ` Mark Wielaard
  0 siblings, 1 reply; 7+ messages in thread
From: Dr Andrew John Hughes @ 2011-09-07 15:35 UTC (permalink / raw)
  To: Pavel Tisnovsky; +Cc: mauve-discuss

On 13:35 Wed 07 Sep     , Pavel Tisnovsky wrote:
> Dr Andrew John Hughes wrote:
> > On 17:09 Fri 02 Sep     , Pavel Tisnovsky wrote:
> >> Dr Andrew John Hughes wrote:
> >>> On 16:17 Fri 02 Sep     , Pavel Tisnovsky wrote:
> >>>> 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
> >>> Do tests still pass with these changes?
> >> yes
> > 
> > On both OpenJDK and GNU Classpath?
> 
> They pass only on OpenJDK. On GNU Classpath (4.4.4), some tests failed
> regardless of whether the patch has been applied or not. But the failures
> occurred on previous test not touched by the patch:
> 
>         ta2.setText("");
>         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 == 0);
>         harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
> 
> before the line wrap & word wrap is enabled.
> 
> The proposed patch fixes other failures on OpenJDK & GNU Classpath too, ie:
> OpenJDK:       6 failures -> 0 failures
> GNU Classpath: 8 failures -> 2 failures
> 
> Pavel

You seem to have sent this twice...

I guess this is ok, but I have to admit I don't really know this GUI stuff that
well.  Would be good if someone else could take a look.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
  2011-09-07 15:35         ` Dr Andrew John Hughes
@ 2011-09-12  9:13           ` Mark Wielaard
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Wielaard @ 2011-09-12  9:13 UTC (permalink / raw)
  To: Dr Andrew John Hughes; +Cc: Pavel Tisnovsky, mauve-discuss

On Wed, 2011-09-07 at 16:35 +0100, Dr Andrew John Hughes wrote:
> On 13:35 Wed 07 Sep     , Pavel Tisnovsky wrote:
> I guess this is ok, but I have to admit I don't really know this GUI stuff that
> well.  Would be good if someone else could take a look.

It does make sense to me to change the tests as Pavel suggests.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-12  9:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 14:15 RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java Pavel Tisnovsky
2011-09-02 15:03 ` Dr Andrew John Hughes
2011-09-02 15:07   ` Pavel Tisnovsky
2011-09-07  2:39     ` Dr Andrew John Hughes
2011-09-07 11:34       ` Pavel Tisnovsky
2011-09-07 15:35         ` Dr Andrew John Hughes
2011-09-12  9:13           ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).