From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26792 invoked by alias); 20 Feb 2006 11:30:09 -0000 Received: (qmail 26743 invoked by uid 22791); 20 Feb 2006 11:30:07 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 20 Feb 2006 11:30:03 +0000 Received: (qmail invoked by alias); 20 Feb 2006 11:30:01 -0000 Received: from e178210078.adsl.alicedsl.de (EHLO [10.11.11.10]) [85.178.210.78] by mail.gmx.net (mp027) with SMTP; 20 Feb 2006 12:30:01 +0100 X-Authenticated: #17532834 Message-ID: <43F9A794.5020306@gmx.net> Date: Mon, 20 Feb 2006 11:30:00 -0000 From: Robert Schuster User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.12) Gecko/20051208 MIME-Version: 1.0 To: mauve-patches@sources.redhat.com Subject: FYI: PlainDocument remove - new test Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBBFCFBE2C57B6FB495724915" X-Y-GMX-Trusted: 0 X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00154.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBBFCFBE2C57B6FB495724915 Content-Type: multipart/mixed; boundary="------------090305050001000207080307" This is a multi-part message in MIME format. --------------090305050001000207080307 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 260 Hi, this adds a new test for PlainDocument remove. It was the basis for my fix for PR 26354. 2006-02-20 Robert Schuster * gnu/testlet/javax/swing/text/GapContent/remove.java: (testGeneral): Added test. cya Robert --------------090305050001000207080307 Content-Type: text/x-patch; name="mauve-plaindocument-remove.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mauve-plaindocument-remove.diff" Content-length: 2059 Index: gnu/testlet/javax/swing/text/PlainDocument/remove.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/PlainDocument/remove.java,v retrieving revision 1.1 diff -u -r1.1 remove.java --- gnu/testlet/javax/swing/text/PlainDocument/remove.java 25 Jan 2006 18:15:10 -0000 1.1 +++ gnu/testlet/javax/swing/text/PlainDocument/remove.java 20 Feb 2006 11:28:38 -0000 @@ -1,6 +1,7 @@ /* remove.java -- Some checks for the remove() method in the PlainDocument class. Copyright (C) 2006 David Gilbert + Copyright (C) 2006 Robert Schuster This file is part of Mauve. Mauve is free software; you can redistribute it and/or modify @@ -28,6 +29,7 @@ import gnu.testlet.Testlet; import javax.swing.text.BadLocationException; +import javax.swing.text.Element; import javax.swing.text.PlainDocument; import javax.swing.text.Position; @@ -43,6 +45,8 @@ { testArguments(harness); testPositions(harness); + + testBehavior(harness); } public void testArguments(TestHarness harness) @@ -153,4 +157,39 @@ } } -} \ No newline at end of file + private void testBehavior(TestHarness harness) + { + harness.checkPoint("testArguments"); + + PlainDocument pd = new PlainDocument(); + int index0 = -1; + int index1 = -1; + + try + { + pd.insertString(0, "abc\ndef\n", null); + + // Delete the 'c'. + pd.remove(2, 1); + + Element re = pd.getDefaultRootElement(); + + // There should still be two separate lines + // (no Element merge should have taken place). + index0 = re.getElementIndex(2); + index1 = re.getElementIndex(3); + } + catch (BadLocationException ble) + { + // Very odd. This should not happen. + index0 = -1; + index1 = -1; + } + finally + { + harness.check(index0, 0); + harness.check(index1, 1); + } + + } +} --------------090305050001000207080307-- --------------enigBBFCFBE2C57B6FB495724915 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 252 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD+aeUG9cfwmwwEtoRAgSHAJ4mH8ondJg3Iy+13iixuerCIswg+QCfe9Wg We9PAuUGZtLcmnd22VAjVxY= =xiWw -----END PGP SIGNATURE----- --------------enigBBFCFBE2C57B6FB495724915--