From: Pavel Tisnovsky <ptisnovs@redhat.com>
To: Dr Andrew John Hughes <ahughes@redhat.com>
Cc: mauve-discuss@sourceware.org
Subject: Re: RFC: fix for Mauve test javax/swing/JTextArea/prefferedSize.java
Date: Fri, 02 Sep 2011 15:07:00 -0000 [thread overview]
Message-ID: <4E60F1A3.1080909@redhat.com> (raw)
In-Reply-To: <20110902150332.GC19081@rivendell.middle-earth.co.uk>
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
next prev parent reply other threads:[~2011-09-02 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 14:15 Pavel Tisnovsky
2011-09-02 15:03 ` Dr Andrew John Hughes
2011-09-02 15:07 ` Pavel Tisnovsky [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E60F1A3.1080909@redhat.com \
--to=ptisnovs@redhat.com \
--cc=ahughes@redhat.com \
--cc=mauve-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).