From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19879 invoked by alias); 28 Nov 2006 13:14:30 -0000 Received: (qmail 19859 invoked by uid 22791); 28 Nov 2006 13:14:28 -0000 X-Spam-Check-By: sourceware.org Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.187) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Nov 2006 13:14:21 +0000 Received: from [212.126.219.82] (helo=mail.aicas.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1Gp2hM3TTn-0008Tl; Tue, 28 Nov 2006 14:08:32 +0100 Received: from mail.aicas.burg (caribic.aicas.burg [192.168.1.3]) by mail.aicas.de (Postfix) with ESMTP id 6C76654000D for ; Tue, 28 Nov 2006 14:08:32 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.aicas.burg (Postfix) with ESMTP id 4B8266BC989 for ; Tue, 28 Nov 2006 14:08:32 +0100 (CET) Received: from mail.aicas.burg ([127.0.0.1]) by localhost (www.aicas.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07966-08 for ; Tue, 28 Nov 2006 14:08:29 +0100 (CET) Received: from [192.168.1.112] (moonlight.aicas.burg [192.168.1.112]) by mail.aicas.burg (Postfix) with ESMTP id EFF246BC984 for ; Tue, 28 Nov 2006 14:08:24 +0100 (CET) Subject: FYI: fixed TitledBorder tests From: Roman Kennke To: mauve-patches Content-Type: multipart/mixed; boundary="=-f8L5bvrBEyfeCTbOm+i5" Date: Tue, 28 Nov 2006 13:14:00 -0000 Message-Id: <1164719304.6844.8.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00755.txt.bz2 --=-f8L5bvrBEyfeCTbOm+i5 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 706 In the TitledBorder tests I believe we had a slight mistake. We were treating the font height to be equal to ascent+descent, which is not necessarily the case. In our case we really want to check for ascent +descent except for one case (BELOW_BOTTOM) where we have to include the line distance. The problem here is that line distance is really 0 for many fonts, so this is a corner case that is hard to test. But I'm quite certain that the tests are now correct and they PASS now both with Sun and Classpath. 2006-11-28 Roman Kennke * gnu/testlet/javax/swing/border/TitledBorder/getBorderInsets.java: Fixed test for differentiation between font ascent+descent and height. /Roman --=-f8L5bvrBEyfeCTbOm+i5 Content-Disposition: attachment; filename=patch.diff Content-Type: text/x-patch; name=patch.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2604 Index: gnu/testlet/javax/swing/border/TitledBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/border/TitledBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -1 -5 -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/border/TitledBorder/getBorderInsets.java 10 Oct 2005 08:06:08 -0000 1.1 +++ gnu/testlet/javax/swing/border/TitledBorder/getBorderInsets.java 28 Nov 2006 13:05:35 -0000 @@ -51,53 +51,53 @@ * Runs the test using the specified harness. * * @param harness the test harness (null not permitted). */ public void test1(TestHarness harness) { harness.checkPoint("(Component)"); JPanel p = new JPanel(); TitledBorder b = new TitledBorder(new EmptyBorder(1, 2, 3, 4)); p.setBorder(b); p.setFont(b.getTitleFont()); Insets insets = b.getBorderInsets(p); harness.check(insets, new Insets(5, 6, 7, 8)); FontMetrics fm = p.getFontMetrics(p.getFont()); - int fontHeight = fm.getHeight(); + int fontHeight = fm.getAscent() + fm.getDescent(); b.setTitle("XYZ"); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5 + fontHeight, 6, 7, 8)); b.setTitleFont(new Font("Dialog", Font.PLAIN, 24)); p.setFont(b.getTitleFont()); fm = p.getFontMetrics(p.getFont()); - fontHeight = fm.getHeight(); + fontHeight = fm.getAscent() + fm.getDescent(); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5 + fontHeight, 6, 7, 8)); b.setTitlePosition(TitledBorder.ABOVE_TOP); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5 + fontHeight + 2, 6, 7, 8)); b.setTitlePosition(TitledBorder.TOP); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5 + fontHeight, 6, 7, 8)); b.setTitlePosition(TitledBorder.BELOW_TOP); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5 + fontHeight + 2, 6, 7, 8)); b.setTitlePosition(TitledBorder.ABOVE_BOTTOM); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5, 6, 7 + fontHeight + 2, 8)); b.setTitlePosition(TitledBorder.BOTTOM); insets = b.getBorderInsets(p); harness.check(insets, new Insets(5, 6, 7 + fontHeight, 8)); b.setTitlePosition(TitledBorder.BELOW_BOTTOM); insets = b.getBorderInsets(p); - harness.check(insets, new Insets(5, 6, 7 + fontHeight, 8)); + harness.check(insets, new Insets(5, 6, 7 + fm.getHeight(), 8)); } } --=-f8L5bvrBEyfeCTbOm+i5--