This is the mail archive of the
mauve-patches@sourceware.cygnus.com
mailing list for the Mauve project.
StringTest patches
- To: mauve-patches at sourceware dot cygnus dot com
- Subject: StringTest patches
- From: Anthony Green <green at cygnus dot com>
- Date: Sun, 9 Jan 2000 14:08:22 -0800
I'm committing the following patch to StringTest.java. We should only
be checking for IndexOutOfBoundsException.
StringIndexOutOfBoundsException would probably have been ok.
ArrayIndexOutOfBoundsException was probably wrong.
2000-01-09 Anthony Green <green@cygnus.com>
* gnu/testlet/java/lang/String/StringTest.java (test_getChars,
test_getBytes): Don't check for StringIndexOutOfBoundsException or
ArrayIndexOutOfBoundsException. The spec only mentions
IndexOutOfBoundsException.
Index: gnu/testlet/java/lang/String/StringTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/String/StringTest.java,v
retrieving revision 1.3
diff -u -r1.3 StringTest.java
--- StringTest.java 1999/07/07 09:21:16 1.3
+++ StringTest.java 2000/01/09 22:05:48
@@ -238,35 +238,27 @@
try {
str.getChars(-1 , 3 , dst , 1 );
harness.fail("Error : test_getChars failed - 2");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(4 , 3 , dst , 1 );
harness.fail("Error : test_getChars failed - 3");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 15 , dst , 1 );
harness.fail("Error : test_getChars failed - 4");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 5 , dst , -1 );
harness.fail("Error : test_getChars failed - 5");
- }catch ( ArrayIndexOutOfBoundsException e ){}
- catch ( IndexOutOfBoundsException e ){
- harness.fail("Error : test_getChars failed - 5a"+
- " should throw ArrayIndexOutOfBounds exception");
- }
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 10 , dst , 1 );
harness.fail("Error : test_getChars failed - 6");
- }catch ( ArrayIndexOutOfBoundsException e ){}
- catch ( IndexOutOfBoundsException e ){
- harness.fail("Error : test_getChars failed - 6a"+
- " should throw ArrayIndexOutOfBounds exception");
- }
+ }catch ( IndexOutOfBoundsException e ){}
str.getChars(0,5,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != 'b' || dst[2] != 'c' ||
@@ -301,35 +293,27 @@
try {
str.getBytes(-1 , 3 , dst , 1 );
harness.fail("Error : test_getBytes failed - 2");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(4 , 3 , dst , 1 );
harness.fail("Error : test_getBytes failed - 3");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 15 , dst , 1 );
harness.fail("Error : test_getBytes failed - 4");
- }catch ( StringIndexOutOfBoundsException e ){}
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 5 , dst , -1 );
harness.fail("Error : test_getBytes failed - 5");
- }catch ( ArrayIndexOutOfBoundsException e ){}
- catch ( IndexOutOfBoundsException e ){
- harness.fail("Error : test_getBytes failed - 5a"+
- " should throw ArrayIndexOutOfBounds exception");
- }
+ }catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 10 , dst , 1 );
harness.fail("Error : test_getBytes failed - 6");
- }catch ( ArrayIndexOutOfBoundsException e ){}
- catch ( IndexOutOfBoundsException e ){
- harness.fail("Error : test_getBytes failed - 5a"+
- " should throw ArrayIndexOutOfBounds exception");
- }
+ }catch ( IndexOutOfBoundsException e ){}
str.getBytes(0,5,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != 'b' || dst[2] != 'c' ||
--
Anthony Green Cygnus Solutions
Sunnyvale, California