This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
Patch: misleading output "PASS: Error: ..."
- From: Edwin Steiner <edwin dot steiner at gmx dot net>
- To: mauve-patches at sources dot redhat dot com
- Date: Mon, 23 Jan 2006 14:50:13 +0100
- Subject: Patch: misleading output "PASS: Error: ..."
- References: <20060120195947.GA8058@localhost.localdomain> <1137858855.4418.4.camel@localhost>
Hi!
This string-only patch cleans up test names in java.lang testlets that
contain redundant/misleading "Error", "failed", or "returned wrong
results" parts.
There is still more cleanup to be done, but that's a start.
-Edwin
2005-01-23 Edwin Steiner <edwin.steiner@gmx.net>
* gnu/testlet/java/lang/Byte/ByteTest.java,
gnu/testlet/java/lang/Character/CharacterTest.java,
gnu/testlet/java/lang/Double/DoubleTest.java,
gnu/testlet/java/lang/Float/FloatTest.java,
gnu/testlet/java/lang/Integer/IntegerTest.java,
gnu/testlet/java/lang/Long/LongTest.java,
gnu/testlet/java/lang/Math/MathTest.java,
gnu/testlet/java/lang/Short/ShortTest.java,
gnu/testlet/java/lang/String/StringTest.java,
gnu/testlet/java/lang/StringBuffer/StringBufferTest.java:
Cleaned up test names containing "Error", "failed", or
"returned wrong results".
Index: ./gnu/testlet/java/lang/Byte/ByteTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Byte/ByteTest.java,v
retrieving revision 1.3
diff -u -u -r1.3 ByteTest.java
--- ./gnu/testlet/java/lang/Byte/ByteTest.java 21 Feb 2005 15:52:45 -0000 1.3
+++ ./gnu/testlet/java/lang/Byte/ByteTest.java 22 Jan 2006 21:14:49 -0000
@@ -30,20 +30,20 @@
public void test_Basics()
{
harness.check(!( Byte.MIN_VALUE != -128 ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
harness.check(!( Byte.MAX_VALUE != 127 ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
Byte ch = new Byte((byte)'b');
harness.check(!( ch.byteValue() != (byte)'b' ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
Byte ch1 = new Byte("122");
harness.check(!( ch1.byteValue() != 122 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
harness.check(!( (Byte.valueOf( "120")).byteValue() != 120 ),
- "Error: test_Basics failed - 5" );
+ "test_Basics - 5" );
harness.check(!( (Byte.valueOf( "120")).byteValue() != 120 ),
- "Error: test_Basics failed - 6" );
+ "test_Basics - 6" );
}
@@ -52,7 +52,7 @@
Byte ch = new Byte((byte)'a');
String str = ch.toString();
harness.check(!( str.length() != 2 || !str.equals("97")),
- "Error: test_toString failed " );
+ "test_toString" );
}
@@ -63,7 +63,7 @@
Byte ch3 = new Byte((byte)'-');
harness.check(!( !ch1.equals(ch2) || ch1.equals(ch3) || ch1.equals(null)),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
}
public void test_hashCode( )
@@ -71,28 +71,28 @@
Byte ch1 = new Byte((byte)'a');
harness.check(!( ch1.hashCode() != (int) 'a' ),
- "Error: test_hashCode returned wrong results" );
+ "test_hashCode" );
}
public void test_decode()
{
try {
Byte.decode("1234");
- harness.fail("Error : test_decode failed - 1" );
+ harness.fail("test_decode - 1" );
}
catch ( NumberFormatException e ){}
harness.check(!( Byte.decode("34").intValue() != 34 ),
- "Error : test_decode failed - 2" );
+ "test_decode - 2" );
try {
Byte.decode("123.34");
- harness.fail("Error : test_decode failed - 3" );
+ harness.fail("test_decode - 3" );
}
catch ( NumberFormatException e ){}
try {
Byte.decode("ff");
- harness.fail("Error : test_decode failed - 4" );
+ harness.fail("test_decode - 4" );
}
catch ( NumberFormatException e ){}
@@ -103,30 +103,30 @@
Byte b = new Byte( (byte)100 );
Byte b1 = new Byte((byte) -123 );
harness.check(!( b.intValue () != 100 ),
- "Error : test_values failed - 1" );
+ "test_values - 1" );
harness.check(!( b1.intValue () != -123 ),
- "Error : test_values failed - 2" );
+ "test_values - 2" );
harness.check(!( b.longValue () != 100 ),
- "Error : test_values failed - 3" );
+ "test_values - 3" );
harness.check(!( b1.longValue () != -123 ),
- "Error : test_values failed - 4" );
+ "test_values - 4" );
harness.check(!( b.floatValue () != 100.0f ),
- "Error : test_values failed - 5" );
+ "test_values - 5" );
harness.check(!( b1.floatValue () != -123.0f ),
- "Error : test_values failed - 6" );
+ "test_values - 6" );
harness.check(!( b.doubleValue () != 100.0 ),
- "Error : test_values failed - 7" );
+ "test_values - 7" );
harness.check(!( b1.doubleValue () != -123.0 ),
- "Error : test_values failed - 8" );
+ "test_values - 8" );
harness.check(!( b.shortValue () != 100 ),
- "Error : test_values failed - 9" );
+ "test_values - 9" );
harness.check(!( b1.shortValue () != -123 ),
- "Error : test_values failed - 10" );
+ "test_values - 10" );
harness.check(!( b.byteValue () != 100 ),
- "Error : test_values failed - 11" );
+ "test_values - 11" );
harness.check(!( b1.byteValue () != -123 ),
- "Error : test_values failed - 12" );
+ "test_values - 12" );
}
public void testall()
Index: ./gnu/testlet/java/lang/Character/CharacterTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Character/CharacterTest.java,v
retrieving revision 1.3
diff -u -u -r1.3 CharacterTest.java
--- ./gnu/testlet/java/lang/Character/CharacterTest.java 21 Feb 2005 15:52:45 -0000 1.3
+++ ./gnu/testlet/java/lang/Character/CharacterTest.java 22 Jan 2006 21:14:49 -0000
@@ -30,33 +30,33 @@
public void test_Basics()
{
harness.check(!(Character.forDigit(8, 2) != '\0'),
- "Error: test_forDigit - 50");
+ "test_forDigit - 50");
harness.check(!(Character.forDigit(-3, 2) != '\0'),
- "Error: test_forDigit - 51");
+ "test_forDigit - 51");
harness.check(!(Character.forDigit(2, 8) != '2'),
- "Error: test_forDigit - 52");
+ "test_forDigit - 52");
harness.check(!(Character.forDigit(12, 16) != 'c'),
- "Error: test_forDigit - 53");
+ "test_forDigit - 53");
harness.check(!(Character.isJavaLetter('\uFFFF')),
- "Error: test_forDigit - 54");
+ "test_forDigit - 54");
harness.check(!(!Character.isJavaLetter('a')),
- "Error: test_forDigit - 55");
+ "test_forDigit - 55");
harness.check(!( Character.MIN_VALUE != '\u0000' ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
harness.check(!( Character.MAX_VALUE != '\uffff' ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
harness.check(!( Character.MIN_RADIX != 2 ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
harness.check(!( Character.MAX_RADIX != 36 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
Character ch = new Character('b');
harness.check(!( ch.charValue() != 'b' ),
- "Error: test_Basics failed - 5" );
+ "test_Basics - 5" );
}
public void test_toString()
@@ -65,7 +65,7 @@
String str = ch.toString();
harness.check(!( str.length() != 1 || !str.equals("a")),
- "Error: test_toString failed " );
+ "test_toString " );
}
@@ -76,7 +76,7 @@
Character ch3 = new Character('-');
harness.check(!( !ch1.equals(ch2) || ch1.equals(ch3) || ch1.equals(null)),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
}
public void test_hashCode( )
@@ -84,7 +84,7 @@
Character ch1 = new Character('a');
harness.check(!( ch1.hashCode() != (int) 'a' ),
- "Error: test_hashCode returned wrong results" );
+ "test_hashCode" );
}
@@ -96,7 +96,7 @@
!Character.isSpace('\n') ||
!Character.isSpace(' ') ||
Character.isSpace('+') ),
- "Error: test_isSpace returned wrong results" );
+ "test_isSpace" );
}
@@ -104,9 +104,9 @@
{
// radix wrong
harness.check(!( Character.digit( 'a' , Character.MIN_RADIX - 1 ) != -1 ),
- "Error: test_digit returned wrong results - 1" );
+ "test_digit - 1" );
harness.check(!( Character.digit( 'a' , Character.MAX_RADIX + 1 ) != -1 ),
- "Error: test_digit returned wrong results - 2" );
+ "test_digit - 2" );
}
@@ -141,9 +141,9 @@
// not supported Character.isJavaLetter( 'a' );
Character.isJavaLetterOrDigit( 'a' );
harness.check(!(Character.isJavaLetterOrDigit('\uFFFF')),
- "Error: isJavaLetterOrDigit - 60");
+ "isJavaLetterOrDigit - 60");
harness.check(!(Character.isLetterOrDigit('\uFFFF')),
- "Error: isLetterOrDigit - 61");
+ "isLetterOrDigit - 61");
// not supported Character.isLetter( 'a' );
Index: ./gnu/testlet/java/lang/Double/DoubleTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Double/DoubleTest.java,v
retrieving revision 1.7
diff -u -u -r1.7 DoubleTest.java
--- ./gnu/testlet/java/lang/Double/DoubleTest.java 21 Feb 2005 15:52:46 -0000 1.7
+++ ./gnu/testlet/java/lang/Double/DoubleTest.java 22 Jan 2006 21:14:49 -0000
@@ -42,27 +42,27 @@
Double nan2 = new Double(Double.NaN);
if ( min1 != min2 ) {
- harness.fail("Error: test_Basics failed - 1a");
+ harness.fail("test_Basics - 1a");
System.out.println("Expected: " + min1);
System.out.println("Got: " + min2);
}
if ( max1 != max2 ) {
- harness.fail("Error: test_Basics failed - 1b");
+ harness.fail("test_Basics - 1b");
System.out.println("Expected: " + max1);
System.out.println("Got: " + max2);
}
if (ninf1 != ninf2) {
- harness.fail("Error: test_Basics failed - 1c");
+ harness.fail("test_Basics - 1c");
System.out.println("Expected: " + ninf1);
System.out.println("Got: " + ninf2);
}
if (pinf1 != pinf2) {
- harness.fail("Error: test_Basics failed - 1d");
+ harness.fail("test_Basics - 1d");
System.out.println("Expected: " + pinf1);
System.out.println("Got: " + pinf2);
}
if (!nan2.equals(nan1) ) {
- harness.fail("Error: test_Basics failed CYGNUS: NaN.equals - 1e");
+ harness.fail("test_Basics CYGNUS: NaN.equals - 1e");
System.out.println("Expected: " + nan1);
System.out.println("Got: " + nan2);
}
@@ -70,110 +70,110 @@
Double i1 = new Double(100.5);
harness.check(!( i1.doubleValue() != 100.5 ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
try {
harness.check(!( (new Double("234.34")).doubleValue() != 234.34 ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 3" );
+ harness.fail("test_Basics - 3" );
}
try {
harness.check(!( (new Double("1.4e-45")).doubleValue() != 1.4e-45 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 4" );
+ harness.fail("test_Basics - 4" );
}
try {
new Double("babu");
- harness.fail("Error: test_Basics failed - 5" );
+ harness.fail("test_Basics - 5" );
}
catch ( NumberFormatException e )
{
}
harness.check(!( (new Double(3.4)).doubleValue() != 3.4 ),
- "Error: test_Basics failed - 6" );
+ "test_Basics - 6" );
Double nan = new Double(Double.NaN );
harness.check(!( !nan.isNaN()),
- "Error: test_Basics failed - 7" );
+ "test_Basics - 7" );
harness.check(!( (new Double(10.0f)).isNaN()),
- "Error: test_Basics failed - 8" );
+ "test_Basics - 8" );
harness.check(!( !Double.isNaN( Double.NaN )),
- "Error: test_Basics failed - 9" );
+ "test_Basics - 9" );
harness.check(!( !(new Double(Double.POSITIVE_INFINITY)).isInfinite()),
- "Error: test_Basics failed - 10" );
+ "test_Basics - 10" );
harness.check(!( !(new Double(Double.NEGATIVE_INFINITY)).isInfinite()),
- "Error: test_Basics failed - 11" );
+ "test_Basics - 11" );
harness.check(!( !( Double.isInfinite( Double.NEGATIVE_INFINITY))),
- "Error: test_Basics failed - 12" );
+ "test_Basics - 12" );
harness.check(!( !( Double.isInfinite( Double.POSITIVE_INFINITY))),
- "Error: test_Basics failed - 13" );
+ "test_Basics - 13" );
harness.check(!( 0.0 - 0.0 != 0.0),
- "Error: test_Basics failed - 14" );
+ "test_Basics - 14" );
harness.check(!( 0.0 + 0.0 != 0.0),
- "Error: test_Basics failed - 15" );
+ "test_Basics - 15" );
harness.check(!( 0.0 + -0.0 != 0.0),
- "Error: test_Basics failed - 16" );
+ "test_Basics - 16" );
harness.check(!( 0.0 - -0.0 != 0.0),
- "Error: test_Basics failed - 17" );
+ "test_Basics - 17" );
harness.check(!( -0.0 - 0.0 != -0.0),
- "Error: test_Basics failed - 18" );
+ "test_Basics - 18" );
harness.check(!( -0.0 + 0.0 != 0.0),
- "Error: test_Basics failed - 19" );
+ "test_Basics - 19" );
harness.check(!( -0.0 + -0.0 != -0.0),
- "Error: test_Basics failed - 20" );
+ "test_Basics - 20" );
harness.check(!( -0.0 - -0.0 != 0.0),
- "Error: test_Basics failed - 21" );
+ "test_Basics - 21" );
harness.check(!( !"0.0".equals(0.0 - 0.0 +"" )),
- "Error: test_Basics failed - 22" );
+ "test_Basics - 22" );
}
public void test_toString()
{
harness.check(!( !( new Double(123.0)).toString().equals("123.0")),
- "Error: test_toString failed - 1" );
+ "test_toString - 1" );
harness.check(!( !( new Double(-44.5343)).toString().equals("-44.5343")),
- "Error: test_toString failed - 2" );
+ "test_toString - 2" );
harness.check(!( !Double.toString( 23.04 ).equals ("23.04" )),
- "Error: test_toString failed - 3" );
+ "test_toString - 3" );
harness.check(!( !Double.toString( Double.NaN ).equals ("NaN" )),
- "Error: test_toString failed - 4" );
+ "test_toString - 4" );
harness.check(!( !Double.toString( Double.POSITIVE_INFINITY ).equals ("Infinity" )),
- "Error: test_toString failed - 5" );
+ "test_toString - 5" );
harness.check(!( !Double.toString( Double.NEGATIVE_INFINITY ).equals ("-Infinity" )),
- "Error: test_toString failed - 6" );
+ "test_toString - 6" );
harness.check(!( !Double.toString( 0.0 ).equals ("0.0" )),
- "Error: test_toString failed - 7" );
+ "test_toString - 7" );
String str;
str = Double.toString( -0.0 );
harness.check(!( !str.equals ("-0.0" )),
- "Error: test_toString failed - 8" );
+ "test_toString - 8" );
str = Double.toString( -9412128.34 );
harness.check(!( !str.equals ("-9412128.34" )),
- "Error: test_toString failed - 9" );
+ "test_toString - 9" );
// The following case fails for some Sun JDKs (e.g. 1.3.1
// and 1.4.0) where toString(0.001) returns "0.0010". This
@@ -181,21 +181,21 @@
// case has been noted as a comment to Sun Java bug #4642835
str = Double.toString( 0.001 );
if ( !Double.toString( 0.001 ).equals ("0.001" )) {
- harness.fail("Error: test_toString failed - 10" );
+ harness.fail("test_toString - 10" );
System.out.println("Expected: " + "0.001");
System.out.println("Got: " + Double.toString(0.001));
}
str = Double.toString( 1e4d );
if ( !Double.toString( 1e4d ).equals ("10000.0" )) {
- harness.fail("Error: test_toString failed - 11" );
+ harness.fail("test_toString - 11" );
System.out.println("Expected: " + "10000.0");
System.out.println("Got: " + Double.toString(1e4d));
}
str = Double.toString(33333333.33 );
if ( !(new Double( str)).equals(new Double(33333333.33))) {
- harness.fail("Error: test_toString failed - 12" );
+ harness.fail("test_toString - 12" );
System.out.println("Expected: " +
(new Double(33333333.33)).toString());
System.out.println("Got: " +
@@ -203,7 +203,7 @@
}
str = Double.toString(-123232324253.32 );
if ( !(new Double( str)).equals(new Double(-123232324253.32))) {
- harness.fail("Error: test_toString failed - 13" );
+ harness.fail("test_toString - 13" );
System.out.println("Expected: " +
(new Double(-123232324253.32)).toString());
System.out.println("Got: " +
@@ -211,7 +211,7 @@
}
str = Double.toString(1.243E10);
if ( !(new Double( str)).equals(new Double(1.243E10))) {
- harness.fail("Error: test_toString failed - 14" );
+ harness.fail("test_toString - 14" );
System.out.println("Expected: " +
(new Double(1.243E10)).toString());
System.out.println("Got: " +
@@ -219,7 +219,7 @@
}
str = Double.toString(-23.43E33);
/* if ( !(new Double( str)).equals(new Double(-23.43E33)))
- harness.fail("Error: test_toString failed - 14" );
+ harness.fail("test_toString - 14" );
*/
@@ -231,35 +231,35 @@
Double i2 = new Double(-2334.34E4);
harness.check(!( !i1.equals( new Double(2334.34E4))),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
harness.check(!( !i2.equals( new Double(-2334.34E4))),
- "Error: test_equals failed - 2" );
+ "test_equals - 2" );
harness.check(!( i1.equals( i2 )),
- "Error: test_equals failed - 3" );
+ "test_equals - 3" );
harness.check(!( i1.equals(null)),
- "Error: test_equals failed - 4" );
+ "test_equals - 4" );
double n1 = Double.NaN;
double n2 = Double.NaN;
harness.check(!( n1 == n2 ),
- "Error: test_equals failed - 5" );
+ "test_equals - 5" );
Double flt1 = new Double( Double.NaN);
Double flt2 = new Double( Double.NaN);
harness.check(!( !flt1.equals(flt2)),
- "Error: test_equals failed CYGNUS: NaN.equals - 6" );
+ "test_equals CYGNUS: NaN.equals - 6" );
harness.check(!( 0.0 != -0.0 ),
- "Error: test_equals failed - 7" );
+ "test_equals - 7" );
Double pzero = new Double( 0.0 );
Double nzero = new Double( -0.0 );
harness.check(!( pzero.equals(nzero) ),
- "Error: test_equals failed CYGNUS: Double.equals - 8" );
+ "test_equals CYGNUS: Double.equals - 8" );
}
@@ -270,13 +270,13 @@
long lng1 = Double.doubleToLongBits( 3.4028235e+38);
harness.check(!( flt1.hashCode() != (int) ( lng1^(lng1>>>32)) ),
- "Error: test_hashCode returned wrong results - 1");
+ "test_hashCode - 1");
Double flt2 = new Double( -2343323354.0 );
long lng2 = Double.doubleToLongBits( -2343323354.0 );
harness.check(!( flt2.hashCode() != (int) ( lng2^(lng2>>>32)) ),
- "Error: test_hashCode returned wrong results - 2");
+ "test_hashCode - 2");
}
public void test_intValue( )
@@ -288,25 +288,25 @@
int i2 = b2.intValue();
harness.check(!( i1 != (int) 3.4e+32),
- "Error: test_intValue returned wrong results CYGNUS: Float to int conversions - 1" );
+ "test_intValue CYGNUS: Float to int conversions - 1" );
harness.check(!( i2 != (int) -23.45 ),
- "Error: test_intValue returned wrong results - 2" );
+ "test_intValue - 2" );
Double b3 = new Double(3000.54);
harness.check(!( b3.intValue() != 3000 ),
- "Error: test_intValue returned wrong results - 3" );
+ "test_intValue - 3" );
Double b4 = new Double(32735.3249);
harness.check(!( b4.intValue() != 32735 ),
- "Error: test_intValue returned wrong results - 4" );
+ "test_intValue - 4" );
Double b5 = new Double(-32735.3249);
harness.check(!( b5.intValue() != -32735 ),
- "Error: test_intValue returned wrong results - 5" );
+ "test_intValue - 5" );
Double b6 = new Double(-32735.3249);
harness.check(!( b6.intValue() != -32735 ),
- "Error: test_intValue returned wrong results - 6" );
+ "test_intValue - 6" );
Double b7 = new Double(0.0);
harness.check(!( b7.intValue() != 0 ),
- "Error: test_intValue returned wrong results - 7" );
+ "test_intValue - 7" );
}
public void test_longValue( )
@@ -315,10 +315,10 @@
Double b2 = new Double(-23.45);
harness.check(!( b1.longValue() != (long) 3.4e+32),
- "Error: test_longValue returned wrong results CYGNUS: Float to int conversions - 1" );
+ "test_longValue CYGNUS: Float to int conversions - 1" );
harness.check(!( b2.longValue() != (long) -23.45 ),
- "Error: test_longValue returned wrong results - 2" );
+ "test_longValue - 2" );
}
public void test_DoubleValue( )
@@ -327,10 +327,10 @@
Double b2 = new Double(-3276.32);
harness.check(!( b1.doubleValue() != 3276.34 ),
- "Error: test_DoubleValue returned wrong results - 1" );
+ "test_DoubleValue - 1" );
harness.check(!( b2.doubleValue() != -3276.32 ),
- "Error: test_DoubleValue returned wrong results - 2" );
+ "test_DoubleValue - 2" );
}
public void test_doubleValue( )
@@ -339,10 +339,10 @@
Double b2 = new Double(30.0);
harness.check(!( b1.doubleValue() != 0.0 ),
- "Error: test_doubleValue returned wrong results - 1" );
+ "test_doubleValue - 1" );
harness.check(!( b2.doubleValue() != 30.0 ),
- "Error: test_doubleValue returned wrong results - 2" );
+ "test_doubleValue - 2" );
}
public void test_floatValue( )
@@ -351,17 +351,17 @@
Double b2 = new Double(30.0);
harness.check(!( b1.floatValue() != 0.0f ),
- "Error: test_floatValue returned wrong results - 1" );
+ "test_floatValue - 1" );
harness.check(!( b2.floatValue() != 30.0f ),
- "Error: test_floatValue returned wrong results - 2" );
+ "test_floatValue - 2" );
}
public void test_valueOf( )
{
try {
Double.valueOf(null);
- harness.fail("Error: test_valueOf returned wrong results - 1" );
+ harness.fail("test_valueOf - 1" );
}
catch ( NumberFormatException nfe )
{harness.check(false, "test_valueOf null should throw NullPointerException");}
@@ -370,21 +370,21 @@
try {
Double.valueOf("Kona");
- harness.fail("Error: test_valueOf returned wrong results - 2" );
+ harness.fail("test_valueOf - 2" );
}catch( NumberFormatException e) {}
harness.check(!( Double.valueOf( "3.4e+32" ).doubleValue() != 3.4e+32 ),
- "Error: test_valueOf returned wrong results - 3" );
+ "test_valueOf - 3" );
harness.check(!( Double.valueOf(" -23.45 ").doubleValue() != -23.45 ),
- "Error: test_valueOf returned wrong results - 4" );
+ "test_valueOf - 4" );
}
public void test_parseDouble( )
{
try {
Double.parseDouble(null);
- harness.fail("Error: test_parseDouble returned wrong results - 1" );
+ harness.fail("test_parseDouble - 1" );
}
catch ( NumberFormatException nfe )
{harness.check(false, "test_parseDouble null should throw NullPointerException");}
@@ -393,26 +393,26 @@
try {
Double.parseDouble("Kona");
- harness.fail("Error: test_parseDouble returned wrong results - 2" );
+ harness.fail("test_parseDouble - 2" );
}catch( NumberFormatException e) {}
harness.check(!( Double.parseDouble( "3.4e+32" ) != 3.4e+32 ),
- "Error: test_parseDouble returned wrong results - 3" );
+ "test_parseDouble - 3" );
harness.check(!( Double.parseDouble(" -23.45 ") != -23.45 ),
- "Error: test_parseDouble returned wrong results - 4" );
+ "test_parseDouble - 4" );
}
public void test_doubleToLongBits()
{
harness.check(!( Double.doubleToLongBits( Double.POSITIVE_INFINITY ) != 0x7ff0000000000000L ),
- "Error: test_doubleToLongBits returned wrong results - 1" );
+ "test_doubleToLongBits - 1" );
harness.check(!( Double.doubleToLongBits( Double.NEGATIVE_INFINITY ) != 0xfff0000000000000L ),
- "Error: test_doubleToLongBits returned wrong results - 2" );
+ "test_doubleToLongBits - 2" );
long nanval = Double.doubleToLongBits( Double.NaN );
harness.check(!( nanval != 0x7ff8000000000000L ),
- "Error: test_doubleToLongBits CYGNUS: NaN.doubleToLongBits" );
+ "test_doubleToLongBits CYGNUS: NaN.doubleToLongBits" );
long i1 = Double.doubleToLongBits(3.4e+32f);
long i2 = Double.doubleToLongBits(-34.56f);
@@ -427,55 +427,55 @@
long man2 = i2 & 0x000fffffffffffffL ;
harness.check(!(sign1 != 0 ),
- "Error: test_doubleToLongBits returned wrong results - 4" );
+ "test_doubleToLongBits - 4" );
harness.check(!( sign2 != 0x8000000000000000L ),
- "Error: test_doubleToLongBits returned wrong results - 5" );
+ "test_doubleToLongBits - 5" );
harness.check(!( exp1 != 5093571178556030976L ),
- "Error: test_doubleToLongBits returned wrong results - 6" );
+ "test_doubleToLongBits - 6" );
harness.check(!( exp2 != 4629700416936869888L ),
- "Error: test_doubleToLongBits returned wrong results - 7" );
+ "test_doubleToLongBits - 7" );
harness.check(!( man1 != 214848222789632L ),
- "Error: test_doubleToLongBits returned wrong results - 8" );
+ "test_doubleToLongBits - 8" );
harness.check(!( man2 != 360288163463168L ),
- "Error: test_doubleToLongBits returned wrong results - 9" );
+ "test_doubleToLongBits - 9" );
}
public void test_longBitsToDouble( )
{
harness.check(!( Double.longBitsToDouble( 0x7ff0000000000000L) != Double.POSITIVE_INFINITY ),
- "Error: test_longBitsToDouble returned wrong results - 1" );
+ "test_longBitsToDouble - 1" );
harness.check(!( Double.longBitsToDouble( 0xfff0000000000000L ) != Double.NEGATIVE_INFINITY ),
- "Error: test_longBitsToDouble returned wrong results - 2" );
+ "test_longBitsToDouble - 2" );
harness.check(!( !Double.isNaN(Double.longBitsToDouble( 0xfff8000000000000L ))),
- "Error: test_longBitsToDouble returned wrong results - 3" );
+ "test_longBitsToDouble - 3" );
harness.check(!( !Double.isNaN(Double.longBitsToDouble( 0x7ffffff000000000L ))),
- "Error: test_longBitsToDouble returned wrong results - 4" );
+ "test_longBitsToDouble - 4" );
harness.check(!( !Double.isNaN(Double.longBitsToDouble( 0xfff8000020000001L ))),
- "Error: test_longBitsToDouble returned wrong results - 5" );
+ "test_longBitsToDouble - 5" );
harness.check(!( !Double.isNaN(Double.longBitsToDouble( 0xfffffffffffffff1L ))),
- "Error: test_longBitsToDouble returned wrong results - 6" );
+ "test_longBitsToDouble - 6" );
double fl1 = Double.longBitsToDouble( 0x34343f33 );
if ( Double.doubleToLongBits(fl1) != 0x34343f33 ) {
- harness.fail("Error: test_longBitsToDouble returned wrong results - 7" );
+ harness.fail("test_longBitsToDouble - 7" );
System.out.println("Expected: " + Long.toHexString(0x34343f33));
System.out.println("Got: " + Long.toHexString(Double.doubleToLongBits(fl1)));
}
harness.check(!( Double.doubleToLongBits( Double.longBitsToDouble(0x33439943)) != 0x33439943 ),
- "Error: test_longBitsToDouble returned wrong results - 8");
+ "test_longBitsToDouble - 8");
}
public void check_remainder( double val, double val1 ,
@@ -483,7 +483,7 @@
{
double res = val % val1;
harness.check(!( res < ret - 0.001 || res > ret + 0.001 ),
- "Error: test_remainder failed " + errno );
+ "test_remainder " + errno );
}
public void check_remainder_NaN( double val, double val1 ,
@@ -491,7 +491,7 @@
{
double res = val % val1;
if (!Double.isNaN(res)) {
- harness.fail("Error: test_remainder failed " +
+ harness.fail("test_remainder " +
errno);
}
}
@@ -552,18 +552,18 @@
Double d3 = new Double(0.0 );
harness.check(!( d1.shortValue() != 123 ),
- "Error: test_shortbyteValue failed - 1" );
+ "test_shortbyteValue - 1" );
harness.check(!( d2.shortValue() != 400 ),
- "Error: test_shortbyteValue failed - 2" );
+ "test_shortbyteValue - 2" );
harness.check(!( d3.shortValue() != 0 ),
- "Error: test_shortbyteValue failed - 3" );
+ "test_shortbyteValue - 3" );
harness.check(!( d1.byteValue() != 123 ),
- "Error: test_shortbyteValue failed - 4" );
+ "test_shortbyteValue - 4" );
harness.check(!( d2.byteValue() != (byte) 400 ),
- "Error: test_shortbyteValue failed - 5" );
+ "test_shortbyteValue - 5" );
harness.check(!( d3.byteValue() != 0 ),
- "Error: test_shortbyteValue failed - 6" );
+ "test_shortbyteValue - 6" );
}
@@ -571,38 +571,38 @@
double zero = 0.0;
String zero1 = String.valueOf(zero);
if (!zero1.equals("0.0")) {
- harness.fail("Error: test_neg failed - 1");
+ harness.fail("test_neg - 1");
}
zero = -zero;
String zero2 = String.valueOf(zero);
if (!zero2.equals("-0.0")) {
- harness.fail("Error: test_neg failed - 2");
+ harness.fail("test_neg - 2");
System.out.println("Expected -0.0, got: " + zero2);
}
zero = -zero;
String zero3 = String.valueOf(zero);
if (!zero3.equals("0.0")) {
- harness.fail("Error: test_neg failed - 3");
+ harness.fail("test_neg - 3");
}
double nonzero = -21.23;
String nonzero1 = String.valueOf(nonzero);
if (!nonzero1.equals("-21.23")) {
- harness.fail("Error: test_neg failed - 4");
+ harness.fail("test_neg - 4");
}
nonzero = -nonzero;
String nonzero2 = String.valueOf(nonzero);
if (!nonzero2.equals("21.23")) {
- harness.fail("Error: test_neg failed - 5");
+ harness.fail("test_neg - 5");
}
nonzero = -nonzero;
String nonzero3 = String.valueOf(nonzero);
if (!nonzero3.equals("-21.23")) {
- harness.fail("Error: test_neg failed - 6");
+ harness.fail("test_neg - 6");
}
}
public void testall()
Index: ./gnu/testlet/java/lang/Float/FloatTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Float/FloatTest.java,v
retrieving revision 1.8
diff -u -u -r1.8 FloatTest.java
--- ./gnu/testlet/java/lang/Float/FloatTest.java 21 Feb 2005 15:52:47 -0000 1.8
+++ ./gnu/testlet/java/lang/Float/FloatTest.java 22 Jan 2006 21:14:49 -0000
@@ -44,21 +44,21 @@
harness.check(!( min1 != min2 || max1 != max2 ||
ninf1 != ninf2 || pinf1 != pinf2 ||
!nan2.equals(nan1) ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
Float i1 = new Float(100.5f);
harness.check(!( i1.floatValue() != 100.5f ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
try {
harness.check(!( (new Float("234.34f")).floatValue() != 234.34f ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 3" );
+ harness.fail("test_Basics - 3" );
}
if (!System.getProperty("os.name").equals("VxWorks")){
@@ -66,80 +66,80 @@
// Test is disabled for smallvm 2.0.1 release.
try {
harness.check(!( (new Float("1.4e-45f")).floatValue() != 1.4e-45f ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 4" );
+ harness.fail("test_Basics - 4" );
}
}
try {
new Float("babu");
- harness.fail("Error: test_Basics failed - 5" );
+ harness.fail("test_Basics - 5" );
}
catch ( NumberFormatException e )
{
}
harness.check(!( (new Float(3.4)).floatValue() != 3.4f ),
- "Error: test_Basics failed - 6" );
+ "test_Basics - 6" );
Float nan = new Float(Float.NaN );
harness.check(!( !nan.isNaN()),
- "Error: test_Basics failed - 7" );
+ "test_Basics - 7" );
harness.check(!( (new Float(10.0f)).isNaN()),
- "Error: test_Basics failed - 8" );
+ "test_Basics - 8" );
harness.check(!( !Float.isNaN( Float.NaN )),
- "Error: test_Basics failed - 9" );
+ "test_Basics - 9" );
harness.check(!( !(new Float(Float.POSITIVE_INFINITY)).isInfinite()),
- "Error: test_Basics failed - 10" );
+ "test_Basics - 10" );
harness.check(!( !(new Float(Float.NEGATIVE_INFINITY)).isInfinite()),
- "Error: test_Basics failed - 11" );
+ "test_Basics - 11" );
harness.check(!( !(Float.isInfinite( Float.POSITIVE_INFINITY))),
- "Error: test_Basics failed - 12" );
+ "test_Basics - 12" );
harness.check(!( !(Float.isInfinite( Float.NEGATIVE_INFINITY))),
- "Error: test_Basics failed - 13" );
+ "test_Basics - 13" );
harness.check(!( Float.isInfinite( 2.30f )),
- "Error: test_Basics failed - 14" );
+ "test_Basics - 14" );
}
public void test_toString()
{
harness.check(!( !( new Float(123.0f)).toString().equals("123.0")),
- "Error: test_toString failed - 1" );
+ "test_toString - 1" );
harness.check(!( !( new Float(-44.5343f)).toString().equals("-44.5343")),
- "Error: test_toString failed - 2" );
+ "test_toString - 2" );
harness.check(!( !Float.toString( 23.04f ).equals ("23.04" )),
- "Error: test_toString failed - 3" );
+ "test_toString - 3" );
harness.check(!( !Float.toString( Float.NaN ).equals ("NaN" )),
- "Error: test_toString failed - 4" );
+ "test_toString - 4" );
harness.check(!( !Float.toString( Float.POSITIVE_INFINITY ).equals ("Infinity" )),
- "Error: test_toString failed - 5" );
+ "test_toString - 5" );
harness.check(!( !Float.toString( Float.NEGATIVE_INFINITY ).equals ("-Infinity" )),
- "Error: test_toString failed - 6" );
+ "test_toString - 6" );
harness.check(!( !Float.toString( 0.0f ).equals ("0.0" )),
- "Error: test_toString failed - 7" );
+ "test_toString - 7" );
String str;
str = Float.toString( -0.0f );
harness.check(!( !str.equals ("-0.0" )),
- "Error: test_toString failed - 8" );
+ "test_toString - 8" );
str = Float.toString( -912125.45f);
if ( !str.equals ("-912125.44" )) {
- harness.fail("Error: test_toString failed - 9" );
+ harness.fail("test_toString - 9" );
System.out.println("Bug EJWcr00027");
System.out.println("expected '-912125.45', got '" +
str + "'");
@@ -151,11 +151,11 @@
// case has been noted as a comment to Sun Java bug #4642835
str = Float.toString( 0.001f );
harness.check(!( !Float.toString( 0.001f ).equals ("0.001" )),
- "Error: test_toString failed - 10" );
+ "test_toString - 10" );
str = Float.toString(33333333.33f );
if ( !(new Float( str)).equals(new Float(33333333.33f))) {
- harness.fail("Error: test_toString failed - 11" );
+ harness.fail("test_toString - 11" );
System.out.println("Bug EJWcr00029");
int i = Float.floatToIntBits(new Float( str).floatValue());
int j = Float.floatToIntBits(new Float(33333333.33f).floatValue());
@@ -166,7 +166,7 @@
}
str = Float.toString(-123232324253.32f );
if ( !(new Float( str)).equals(new Float(-123232324253.32f))) {
- harness.fail("Error: test_toString failed - 12" );
+ harness.fail("test_toString - 12" );
System.out.println("Bug EJWcr00030");
int i = Float.floatToIntBits(new Float( str).floatValue());
int j = Float.floatToIntBits(new Float(-123232324253.32f).floatValue());
@@ -177,10 +177,10 @@
}
str = Float.toString(1.243E10f);
harness.check(!( !(new Float( str)).equals(new Float(1.243E10f))),
- "Error: test_toString failed - 13" );
+ "test_toString - 13" );
str = Float.toString(-23.43E33f);
harness.check(!( !(new Float( str)).equals(new Float(-23.43E33f))),
- "Error: test_toString failed - 14" );
+ "test_toString - 14" );
}
@@ -190,36 +190,36 @@
Float i2 = new Float(-2334.34E4);
harness.check(!( !i1.equals( new Float(2334.34E4))),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
harness.check(!( !i2.equals( new Float(-2334.34E4))),
- "Error: test_equals failed - 2" );
+ "test_equals - 2" );
harness.check(!( i1.equals( i2 )),
- "Error: test_equals failed - 3" );
+ "test_equals - 3" );
harness.check(!( i1.equals(null)),
- "Error: test_equals failed - 4" );
+ "test_equals - 4" );
float n1 = Float.NaN;
float n2 = Float.NaN;
harness.check(!( n1 == n2 ),
- "Error: test_equals failed - 5" );
+ "test_equals - 5" );
Float flt1 = new Float( Float.NaN);
Float flt2 = new Float( Float.NaN);
harness.check(!( !flt1.equals(flt2)),
- "Error: test_equals failed - 6" );
+ "test_equals - 6" );
harness.check(!( 0.0f != -0.0f ),
- "Error: test_equals failed - 7" );
+ "test_equals - 7" );
Float pzero = new Float( 0.0f );
Float nzero = new Float( -0.0f );
harness.check(!( pzero.equals(nzero) ),
- "Error: test_equals failed - 8" );
+ "test_equals - 8" );
}
@@ -229,11 +229,11 @@
Float flt1 = new Float(3.4028235e+38f);
harness.check(!( flt1.hashCode() != Float.floatToIntBits( 3.4028235e+38f )),
- "Error: test_hashCode returned wrong results - 1");
+ "test_hashCode - 1");
Float flt2 = new Float( -2343323354f );
harness.check(!( flt2.hashCode() != Float.floatToIntBits( -2343323354f )),
- "Error: test_hashCode returned wrong results - 2");
+ "test_hashCode - 2");
}
public void test_intValue( )
@@ -245,10 +245,10 @@
int i2 = b2.intValue();
harness.check(!( i1 != (int) 3.4e+32f),
- "Error: test_intValue returned wrong results - 1" );
+ "test_intValue - 1" );
harness.check(!( i2 != (int) -23.45f ),
- "Error: test_intValue returned wrong results - 2" );
+ "test_intValue - 2" );
}
public void test_longValue( )
@@ -260,12 +260,12 @@
long l3 = (long)b3;
harness.check(!( b1.longValue() != l3),
- "Error: test_longValue returned wrong results - 1" );
+ "test_longValue - 1" );
b3 = -23.45f;
l3 = (long)b3;
harness.check(!( b2.longValue() != l3),
- "Error: test_longValue returned wrong results - 2" );
+ "test_longValue - 2" );
}
public void test_floatValue( )
@@ -274,10 +274,10 @@
Float b2 = new Float(-3276.32);
harness.check(!( b1.floatValue() != 3276.34f ),
- "Error: test_floatValue returned wrong results - 1" );
+ "test_floatValue - 1" );
harness.check(!( b2.floatValue() != -3276.32f ),
- "Error: test_floatValue returned wrong results - 2" );
+ "test_floatValue - 2" );
}
public void test_doubleValue( )
@@ -286,17 +286,17 @@
Float b2 = new Float(30.0f);
harness.check(!( b1.doubleValue() != 0.0 ),
- "Error: test_doubleValue returned wrong results - 1" );
+ "test_doubleValue - 1" );
harness.check(!( b2.doubleValue() != 30.0 ),
- "Error: test_doubleValue returned wrong results - 2" );
+ "test_doubleValue - 2" );
}
public void test_valueOf( )
{
try {
Float.valueOf(null);
- harness.fail("Error: test_valueOf returned wrong results - 1" );
+ harness.fail("test_valueOf - 1" );
}
catch ( NumberFormatException nfe )
{harness.check(false, "test_valueOf null should throw NullPointerException");}
@@ -306,20 +306,20 @@
try {
Float.valueOf("Kona");
- harness.fail("Error: test_valueOf returned wrong results - 2" );
+ harness.fail("test_valueOf - 2" );
}catch( NumberFormatException e)
{harness.check(true, "test_valueOf Kona");}
try {
harness.check(!( Float.valueOf( "3.4e+32f" ).floatValue() != 3.4e+32f ),
- "Error: test_valueOf returned wrong results - 3" );
+ "test_valueOf - 3" );
}catch( NumberFormatException e)
{harness.check(false, "test_valueOf 3.4e+32f");}
try {
harness.check(!( Float.valueOf(" -23.45f ").floatValue() != -23.45f ),
- "Error: test_valueOf returned wrong results - 4" );
+ "test_valueOf - 4" );
}catch( NumberFormatException e)
{harness.check(false, "test_valueOf \" -23.45f \"");}
@@ -330,7 +330,7 @@
{
try {
Float.parseFloat(null);
- harness.fail("Error: test_parseFloat returned wrong results - 1" );
+ harness.fail("test_parseFloat - 1" );
}
catch ( NumberFormatException nfe )
{harness.check(false, "test_parseFloat null should throw NullPointerException");}
@@ -340,20 +340,20 @@
try {
Float.parseFloat("Kona");
- harness.fail("Error: test_parseFloat returned wrong results - 2" );
+ harness.fail("test_parseFloat - 2" );
}catch( NumberFormatException e)
{harness.check(true, "test_parseFloat Kona");}
try {
harness.check(!( Float.parseFloat( "3.4e+32f" ) != 3.4e+32f ),
- "Error: test_parseFloat returned wrong results - 3" );
+ "test_parseFloat - 3" );
}catch( NumberFormatException e)
{harness.check(false, "test_parseFloat 3.4e+32f");}
try {
harness.check(!( Float.parseFloat(" -23.45f ") != -23.45f ),
- "Error: test_parseFloat returned wrong results - 4" );
+ "test_parseFloat - 4" );
}catch( NumberFormatException e)
{harness.check(false, "test_parseFloat \" -23.45f \"");}
@@ -362,13 +362,13 @@
public void test_floatToIntBits()
{
harness.check(!( Float.floatToIntBits( Float.POSITIVE_INFINITY ) != 0x7f800000 ),
- "Error: test_floatToIntBits returned wrong results - 1" );
+ "test_floatToIntBits - 1" );
harness.check(!( Float.floatToIntBits( Float.NEGATIVE_INFINITY ) != 0xff800000 ),
- "Error: test_floatToIntBits returned wrong results - 2" );
+ "test_floatToIntBits - 2" );
int nanval = Float.floatToIntBits( Float.NaN );
harness.check(!( nanval != 0x7fc00000 ),
- "Error: test_floatToIntBits returned wrong results - 3" );
+ "test_floatToIntBits - 3" );
int i1 = Float.floatToIntBits(3.4e+32f);
int i2 = Float.floatToIntBits(-34.56f);
@@ -383,55 +383,55 @@
int man2 = i2 & 0x007fffff ;
harness.check(!(sign1 != 0 ),
- "Error: test_floatToIntBits returned wrong results - 4" );
+ "test_floatToIntBits - 4" );
harness.check(!( sign2 != 0x80000000 ),
- "Error: test_floatToIntBits returned wrong results - 5" );
+ "test_floatToIntBits - 5" );
harness.check(!( exp1 != 1971322880 ),
- "Error: test_floatToIntBits returned wrong results - 6" );
+ "test_floatToIntBits - 6" );
harness.check(!( exp2 != 1107296256 ),
- "Error: test_floatToIntBits returned wrong results - 7" );
+ "test_floatToIntBits - 7" );
harness.check(!( man1 != 400186 ),
- "Error: test_floatToIntBits returned wrong results - 8" );
+ "test_floatToIntBits - 8" );
harness.check(!( man2 != 671089 ),
- "Error: test_floatToIntBits returned wrong results - 9" );
+ "test_floatToIntBits - 9" );
}
public void test_intBitsToFloat( )
{
harness.check(!( Float.intBitsToFloat( 0x7f800000 ) != Float.POSITIVE_INFINITY ),
- "Error: test_intBitsToFloat returned wrong results - 1" );
+ "test_intBitsToFloat - 1" );
harness.check(!( Float.intBitsToFloat( 0xff800000 ) != Float.NEGATIVE_INFINITY ),
- "Error: test_intBitsToFloat returned wrong results - 2" );
+ "test_intBitsToFloat - 2" );
harness.check(!( !Float.isNaN(Float.intBitsToFloat( 0x7f800002 ))),
- "Error: test_intBitsToFloat returned wrong results - 3" );
+ "test_intBitsToFloat - 3" );
harness.check(!( !Float.isNaN(Float.intBitsToFloat( 0x7f8ffff0 ))),
- "Error: test_intBitsToFloat returned wrong results - 4" );
+ "test_intBitsToFloat - 4" );
harness.check(!( !Float.isNaN(Float.intBitsToFloat( 0xff800002 ) )),
- "Error: test_intBitsToFloat returned wrong results - 5" );
+ "test_intBitsToFloat - 5" );
harness.check(!( !Float.isNaN(Float.intBitsToFloat( 0xfffffff1 ))),
- "Error: test_intBitsToFloat returned wrong results - 6" );
+ "test_intBitsToFloat - 6" );
harness.check(!( !Float.isNaN(Float.intBitsToFloat( 0xffc00000 ))),
- "Error: test_intBitsToFloat returned wrong results - 7" );
+ "test_intBitsToFloat - 7" );
float fl1 = Float.intBitsToFloat( 0x34343f34 );
harness.check(!( fl1 != 1.67868e-007f ),
- "Error: test_intBitsToFloat returned wrong results - 8" );
+ "test_intBitsToFloat - 8" );
harness.check(!( Float.floatToIntBits( Float.intBitsToFloat(0x33439943)) != 0x33439943 ),
- "Error: test_intBitsToFloat returned wrong results - 9");
+ "test_intBitsToFloat - 9");
}
public void test_shortbyteValue()
@@ -441,18 +441,18 @@
Float d3 = new Float(0.0 );
harness.check(!( d1.shortValue() != 123 ),
- "Error: test_shortbyteValue failed - 1" );
+ "test_shortbyteValue - 1" );
harness.check(!( d2.shortValue() != 400 ),
- "Error: test_shortbyteValue failed - 2" );
+ "test_shortbyteValue - 2" );
harness.check(!( d3.shortValue() != 0 ),
- "Error: test_shortbyteValue failed - 3" );
+ "test_shortbyteValue - 3" );
harness.check(!( d1.byteValue() != 123 ),
- "Error: test_shortbyteValue failed - 4" );
+ "test_shortbyteValue - 4" );
harness.check(!( d2.byteValue() != (byte) 400 ),
- "Error: test_shortbyteValue failed - 5" );
+ "test_shortbyteValue - 5" );
harness.check(!( d3.byteValue() != 0 ),
- "Error: test_shortbyteValue failed - 6" );
+ "test_shortbyteValue - 6" );
}
@@ -460,37 +460,37 @@
float zero = 0.0f;
String zero1 = String.valueOf(zero);
if (!zero1.equals("0.0")) {
- harness.fail("Error: test_neg failed - 1");
+ harness.fail("test_neg - 1");
}
zero = -zero;
String zero2 = String.valueOf(zero);
if (!zero2.equals("-0.0")) {
- harness.fail("Error: test_neg failed - 2");
+ harness.fail("test_neg - 2");
}
zero = -zero;
String zero3 = String.valueOf(zero);
if (!zero3.equals("0.0")) {
- harness.fail("Error: test_neg failed - 3");
+ harness.fail("test_neg - 3");
}
float nonzero = -12.24f;
String nonzero1 = String.valueOf(nonzero);
if (!nonzero1.equals("-12.24")) {
- harness.fail("Error: test_neg failed - 4");
+ harness.fail("test_neg - 4");
}
nonzero = -nonzero;
String nonzero2 = String.valueOf(nonzero);
if (!nonzero2.equals("12.24")) {
- harness.fail("Error: test_neg failed - 5");
+ harness.fail("test_neg - 5");
}
nonzero = -nonzero;
String nonzero3 = String.valueOf(nonzero);
if (!nonzero3.equals("-12.24")) {
- harness.fail("Error: test_neg failed - 6");
+ harness.fail("test_neg - 6");
}
}
Index: ./gnu/testlet/java/lang/Integer/IntegerTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Integer/IntegerTest.java,v
retrieving revision 1.4
diff -u -u -r1.4 IntegerTest.java
--- ./gnu/testlet/java/lang/Integer/IntegerTest.java 21 Feb 2005 15:52:47 -0000 1.4
+++ ./gnu/testlet/java/lang/Integer/IntegerTest.java 22 Jan 2006 21:14:49 -0000
@@ -32,29 +32,29 @@
{
harness.check(!( Integer.MIN_VALUE != 0x80000000 ||
Integer.MAX_VALUE != 0x7fffffff ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
harness.check(Integer.TYPE
== new int[0].getClass().getComponentType(),
- "Error: test_Basics failed - 1a");
+ "test_Basics - 1a");
Integer i1 = new Integer(100);
harness.check(!( i1.intValue() != 100 ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
try {
harness.check(!( (new Integer("234")).intValue() != 234 ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 3" );
+ harness.fail("test_Basics - 3" );
}
try {
harness.check(!( (new Integer("-FF")).intValue() != -255 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
}
catch ( NumberFormatException e )
{
@@ -62,56 +62,56 @@
try {
new Integer("babu");
- harness.fail("Error: test_Basics failed - 5" );
+ harness.fail("test_Basics - 5" );
}
catch ( NumberFormatException e )
{
}
harness.check(!( Integer.decode( "123").intValue() != 123 ),
- "Error: test_Basics failed - 6" );
+ "test_Basics - 6" );
harness.check(!( Integer.decode( "32767").intValue() != 32767 ),
- "Error: test_Basics failed - 7" );
+ "test_Basics - 7" );
}
public void test_toString()
{
harness.check(!( !( new Integer(123)).toString().equals("123")),
- "Error: test_toString failed - 1" );
+ "test_toString - 1" );
harness.check(!( !( new Integer(-44)).toString().equals("-44")),
- "Error: test_toString failed - 2" );
+ "test_toString - 2" );
harness.check(!( !Integer.toString( 234 ).equals ("234" )),
- "Error: test_toString failed - 3" );
+ "test_toString - 3" );
harness.check(!( !Integer.toString( -34 ).equals ("-34" )),
- "Error: test_toString failed - 4" );
+ "test_toString - 4" );
harness.check(!( !Integer.toString( -34 ).equals ("-34" )),
- "Error: test_toString failed - 5" );
+ "test_toString - 5" );
harness.check(!( !Integer.toString(99 , 1 ).equals("99")),
- "Error: test_toString failed - 6" );
+ "test_toString - 6" );
harness.check(!( !Integer.toString(99 , 37 ).equals("99")),
- "Error: test_toString failed - 7" );
+ "test_toString - 7" );
harness.check(!( !Integer.toString(15 , 2 ).equals("1111")),
- "Error: test_toString failed - 8" );
+ "test_toString - 8" );
harness.check(!( !Integer.toString(37 , 36 ).equals("11")),
- "Error: test_toString failed - 9" );
+ "test_toString - 9" );
harness.check(!( !Integer.toString(31 , 16 ).equals("1f")),
- "Error: test_toString failed - 10" );
+ "test_toString - 10" );
harness.check(!( !Integer.toString(-99 , 1 ).equals("-99")),
- "Error: test_toString failed - 11" );
+ "test_toString - 11" );
harness.check(!( !Integer.toString(-99 , 37 ).equals("-99")),
- "Error: test_toString failed - 12" );
+ "test_toString - 12" );
harness.check(!( !Integer.toString(-15 , 2 ).equals("-1111")),
- "Error: test_toString failed - 13" );
+ "test_toString - 13" );
harness.check(!( !Integer.toString(-37 , 36 ).equals("-11")),
- "Error: test_toString failed - 14" );
+ "test_toString - 14" );
harness.check(!( !Integer.toString(-31 , 16 ).equals("-1f")),
- "Error: test_toString failed - 15" );
+ "test_toString - 15" );
}
public void test_equals()
@@ -120,16 +120,16 @@
Integer i2 = new Integer(-23);
harness.check(!( !i1.equals( new Integer(23))),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
harness.check(!( !i2.equals( new Integer(-23))),
- "Error: test_equals failed - 2" );
+ "test_equals - 2" );
harness.check(!( i1.equals( i2 )),
- "Error: test_equals failed - 3" );
+ "test_equals - 3" );
harness.check(!( i1.equals(null)),
- "Error: test_equals failed - 4" );
+ "test_equals - 4" );
}
public void test_hashCode( )
@@ -138,7 +138,7 @@
Integer b2 = new Integer(-3439);
harness.check(!( b1.hashCode() != 3439 || b2.hashCode() != -3439 ),
- "Error: test_hashCode returned wrong results" );
+ "test_hashCode" );
}
public void test_intValue( )
@@ -147,10 +147,10 @@
Integer b2 = new Integer(-32767);
harness.check(!( b1.intValue() != 32767 ),
- "Error: test_intValue returned wrong results - 1" );
+ "test_intValue - 1" );
harness.check(!( b2.intValue() != -32767 ),
- "Error: test_intValue returned wrong results - 2" );
+ "test_intValue - 2" );
}
public void test_longValue( )
@@ -159,10 +159,10 @@
Integer b2 = new Integer(-3767);
harness.check(!( b1.longValue() != (long)3767 ),
- "Error: test_longValue returned wrong results - 1" );
+ "test_longValue - 1" );
harness.check(!( b2.longValue() != -3767 ),
- "Error: test_longValue returned wrong results - 2" );
+ "test_longValue - 2" );
}
public void test_floatValue( )
{
@@ -170,10 +170,10 @@
Integer b2 = new Integer(-3276);
harness.check(!( b1.floatValue() != 3276.0f ),
- "Error: test_floatValue returned wrong results - 1" );
+ "test_floatValue - 1" );
harness.check(!( b2.floatValue() != -3276.0f ),
- "Error: test_floatValue returned wrong results - 2" );
+ "test_floatValue - 2" );
}
public void test_doubleValue( )
{
@@ -181,10 +181,10 @@
Integer b2 = new Integer(30);
harness.check(!( b1.doubleValue() != 0.0 ),
- "Error: test_doubleValue returned wrong results - 1" );
+ "test_doubleValue - 1" );
harness.check(!( b2.doubleValue() != 30.0 ),
- "Error: test_doubleValue returned wrong results - 2" );
+ "test_doubleValue - 2" );
}
public void test_shortbyteValue( )
@@ -193,20 +193,20 @@
Integer b2 = new Integer(300);
harness.check(!( b1.byteValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 1" );
+ "test_shortbyteValue - 1" );
harness.check(!( b2.byteValue() != (byte)300 ),
- "Error: test_shortbyteValue returned wrong results - 2" );
+ "test_shortbyteValue - 2" );
harness.check(!( b1.shortValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 3" );
+ "test_shortbyteValue - 3" );
harness.check(!( b2.shortValue() != (short)300 ),
- "Error: test_shortbyteValue returned wrong results - 4" );
+ "test_shortbyteValue - 4" );
harness.check(!( ((Number)b1).shortValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 5" );
+ "test_shortbyteValue - 5" );
harness.check(!( ((Number)b2).byteValue() != (byte)300 ),
- "Error: test_shortbyteValue returned wrong results - 6" );
+ "test_shortbyteValue - 6" );
}
public void test_toHexString()
@@ -217,10 +217,10 @@
str1 = Integer.toHexString( -5361 );
harness.check( "20b7".equals(str),
- "Error: test_toHexString returned wrong results - 1" );
+ "test_toHexString - 1" );
harness.check( "ffffeb0f".equals(str1),
- "Error: test_toHexString returned wrong results - 2" );
+ "test_toHexString - 2" );
}
public void test_toOctalString()
@@ -230,63 +230,63 @@
str1= Integer.toOctalString(-9863 );
harness.check(!( !str.equals("13327")),
- "Error: test_toOctalString returned wrong results - 1" );
+ "test_toOctalString - 1" );
harness.check(!( !str1.equals("37777754571")),
- "Error: test_toOctalString returned wrong results - 2" );
+ "test_toOctalString - 2" );
}
public void test_toBinaryString()
{
harness.check(!( !Integer.toBinaryString(358).equals("101100110")),
- "Error: test_toBinaryString returned wrong results - 1" );
+ "test_toBinaryString - 1" );
harness.check(!( !Integer.toBinaryString( -5478 ).equals("11111111111111111110101010011010")),
- "Error: test_toBinaryString returned wrong results - 2" );
+ "test_toBinaryString - 2" );
}
public void test_parseInt()
{
harness.check(!( Integer.parseInt("473") != Integer.parseInt("473" , 10 )),
- "Error: test_parseInt returned wrong results - 1" );
+ "test_parseInt - 1" );
harness.check(!( Integer.parseInt("0" , 10 ) != 0 ),
- "Error: test_parseInt returned wrong results - 2" );
+ "test_parseInt - 2" );
harness.check(!( Integer.parseInt("473" , 10 ) != 473 ),
- "Error: test_parseInt returned wrong results - 3" );
+ "test_parseInt - 3" );
harness.check(!( Integer.parseInt("-0" , 10 ) != 0 ),
- "Error: test_parseInt returned wrong results - 4" );
+ "test_parseInt - 4" );
harness.check(!( Integer.parseInt("-FF" , 16 ) != -255 ),
- "Error: test_parseInt returned wrong results - 5" );
+ "test_parseInt - 5" );
harness.check(!( Integer.parseInt("1100110" , 2 ) != 102 ),
- "Error: test_parseInt returned wrong results - 6" );
+ "test_parseInt - 6" );
harness.check(!( Integer.parseInt("2147483647" , 10 ) != 2147483647 ),
- "Error: test_parseInt returned wrong results - 7" );
+ "test_parseInt - 7" );
harness.check(!( Integer.parseInt("-2147483647" , 10 ) != -2147483647 ),
- "Error: test_parseInt returned wrong results - 8" );
+ "test_parseInt - 8" );
try {
Integer.parseInt("2147483648" , 10 );
- harness.fail("Error: test_parseInt returned wrong results - 9" );
+ harness.fail("test_parseInt - 9" );
}catch ( NumberFormatException e ){}
try {
Integer.parseInt("99" , 8 );
- harness.fail("Error: test_parseInt returned wrong results - 10" );
+ harness.fail("test_parseInt - 10" );
}catch ( NumberFormatException e ){}
try {
Integer.parseInt("kona" , 10 );
- harness.fail("Error: test_parseInt returned wrong results - 11" );
+ harness.fail("test_parseInt - 11" );
}catch ( NumberFormatException e ){}
harness.check(!( Integer.parseInt("Kona" , 27 ) != 411787 ),
- "Error: test_parseInt returned wrong results - 12" );
+ "test_parseInt - 12" );
}
public void test_valueOf( )
{
harness.check(!( Integer.valueOf("21234").intValue() != Integer.parseInt("21234")),
- "Error: test_valueOf returned wrong results - 1" );
+ "test_valueOf - 1" );
harness.check(!( Integer.valueOf("Kona", 27).intValue() != Integer.parseInt("Kona", 27)),
- "Error: test_valueOf returned wrong results - 2" );
+ "test_valueOf - 2" );
}
public void test_getInteger( )
@@ -309,17 +309,17 @@
harness.check(!( Integer.getInteger("integerkey1").intValue() != 2345 ||
Integer.getInteger("integerkey2").intValue() != -984 ||
Integer.getInteger("integerkey3").intValue() != 0 ),
- "Error: test_getInteger returned wrong results - 1" );
+ "test_getInteger - 1" );
harness.check(!( Integer.getInteger("integerkey4", new Integer(0)).intValue() != 31 ||
Integer.getInteger("integerkey5",new Integer(0)).intValue() != 31 ||
Integer.getInteger("integerkey6",new Integer(0)).intValue() != 15 ),
- "Error: test_getInteger returned wrong results - 2" );
+ "test_getInteger - 2" );
harness.check(!( Integer.getInteger("integerkey7", new Integer(0)).intValue() != 0 ),
- "Error: test_getInteger returned wrong results - 3" );
+ "test_getInteger - 3" );
harness.check(!( Integer.getInteger("integerkey7", 0).intValue() != 0 ),
- "Error: test_getInteger returned wrong results - 4" );
+ "test_getInteger - 4" );
}
Index: ./gnu/testlet/java/lang/Long/LongTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Long/LongTest.java,v
retrieving revision 1.4
diff -u -u -r1.4 LongTest.java
--- ./gnu/testlet/java/lang/Long/LongTest.java 21 Feb 2005 15:52:47 -0000 1.4
+++ ./gnu/testlet/java/lang/Long/LongTest.java 22 Jan 2006 21:14:49 -0000
@@ -36,25 +36,25 @@
long max2 = 0x7fffffffffffffffL;
harness.check(!( min1 != min2 || max1 != max2 ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
Long i1 = new Long(100);
harness.check(!( i1.longValue() != 100 ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
try {
harness.check(!( (new Long("234")).longValue() != 234 ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 3" );
+ harness.fail("test_Basics - 3" );
}
try {
harness.check(!( (new Long("-FF")).longValue() != -255 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
}
catch ( NumberFormatException e )
{
@@ -62,7 +62,7 @@
try {
new Long("babu");
- harness.fail("Error: test_Basics failed - 5" );
+ harness.fail("test_Basics - 5" );
}
catch ( NumberFormatException e )
{
@@ -72,41 +72,41 @@
public void test_toString()
{
harness.check(!( !( new Long(123)).toString().equals("123")),
- "Error: test_toString failed - 1" );
+ "test_toString - 1" );
harness.check(!( !( new Long(-44)).toString().equals("-44")),
- "Error: test_toString failed - 2" );
+ "test_toString - 2" );
harness.check(!( !Long.toString( 234 ).equals ("234" )),
- "Error: test_toString failed - 3" );
+ "test_toString - 3" );
harness.check(!( !Long.toString( -34 ).equals ("-34" )),
- "Error: test_toString failed - 4" );
+ "test_toString - 4" );
harness.check(!( !Long.toString( -34 ).equals ("-34" )),
- "Error: test_toString failed - 5" );
+ "test_toString - 5" );
harness.check(!( !Long.toString(99 , 1 ).equals("99")),
- "Error: test_toString failed - 6" );
+ "test_toString - 6" );
harness.check(!( !Long.toString(99 , 37 ).equals("99")),
- "Error: test_toString failed - 7" );
+ "test_toString - 7" );
harness.check(!( !Long.toString(15 , 2 ).equals("1111")),
- "Error: test_toString failed - 8" );
+ "test_toString - 8" );
harness.check(!( !Long.toString(37 , 36 ).equals("11")),
- "Error: test_toString failed - 9" );
+ "test_toString - 9" );
harness.check(!( !Long.toString(31 , 16 ).equals("1f")),
- "Error: test_toString failed - 10" );
+ "test_toString - 10" );
harness.check(!( !Long.toString(-99 , 1 ).equals("-99")),
- "Error: test_toString failed - 11" );
+ "test_toString - 11" );
harness.check(!( !Long.toString(-99 , 37 ).equals("-99")),
- "Error: test_toString failed - 12" );
+ "test_toString - 12" );
harness.check(!( !Long.toString(-15 , 2 ).equals("-1111")),
- "Error: test_toString failed - 13" );
+ "test_toString - 13" );
harness.check(!( !Long.toString(-37 , 36 ).equals("-11")),
- "Error: test_toString failed - 14" );
+ "test_toString - 14" );
harness.check(!( !Long.toString(-31 , 16 ).equals("-1f")),
- "Error: test_toString failed - 15" );
+ "test_toString - 15" );
}
public void test_equals()
@@ -115,16 +115,16 @@
Long i2 = new Long(-23);
harness.check(!( !i1.equals( new Long(23))),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
harness.check(!( !i2.equals( new Long(-23))),
- "Error: test_equals failed - 2" );
+ "test_equals - 2" );
harness.check(!( i1.equals( i2 )),
- "Error: test_equals failed - 3" );
+ "test_equals - 3" );
harness.check(!( i1.equals(null)),
- "Error: test_equals failed - 4" );
+ "test_equals - 4" );
}
public void test_hashCode( )
@@ -133,7 +133,7 @@
Long b2 = new Long(-34395555);
harness.check(!( b1.hashCode() != ((int)(b1.longValue()^(b1.longValue()>>>32)))
|| b2.hashCode() != ((int)(b2.longValue()^(b2.longValue()>>>32))) ),
- "Error: test_hashCode returned wrong results" );
+ "test_hashCode" );
}
public void test_intValue( )
@@ -142,10 +142,10 @@
Long b2 = new Long(-32767);
harness.check(!( b1.intValue() != 32767 ),
- "Error: test_intValue returned wrong results - 1" );
+ "test_intValue - 1" );
harness.check(!( b2.intValue() != -32767 ),
- "Error: test_intValue returned wrong results - 2" );
+ "test_intValue - 2" );
}
public void test_shortbyteValue( )
{
@@ -153,15 +153,15 @@
Long b2 = new Long(-32767);
harness.check(!( b1.byteValue() != (byte)32767 ),
- "Error: test_shortbyteValue returned wrong results - 1" );
+ "test_shortbyteValue - 1" );
harness.check(!( b2.byteValue() != (byte)-32767 ),
- "Error: test_shortbyteValue returned wrong results - 2" );
+ "test_shortbyteValue - 2" );
harness.check(!( b1.shortValue() != (short)32767 ),
- "Error: test_shortbyteValue returned wrong results - 3" );
+ "test_shortbyteValue - 3" );
harness.check(!( b2.shortValue() != (short)-32767 ),
- "Error: test_shortbyteValue returned wrong results - 4" );
+ "test_shortbyteValue - 4" );
}
public void test_longValue( )
@@ -170,10 +170,10 @@
Long b2 = new Long(9223372036854775807L);
harness.check(!( b1.longValue() != (long)-9223372036854775807L ),
- "Error: test_longValue returned wrong results - 1" );
+ "test_longValue - 1" );
harness.check(!( b2.longValue() != 9223372036854775807L ),
- "Error: test_longValue returned wrong results - 2" );
+ "test_longValue - 2" );
}
public void test_floatValue( )
{
@@ -181,10 +181,10 @@
Long b2 = new Long(-3276);
harness.check(!( b1.floatValue() != 3276.0f ),
- "Error: test_floatValue returned wrong results - 1" );
+ "test_floatValue - 1" );
harness.check(!( b2.floatValue() != -3276.0f ),
- "Error: test_floatValue returned wrong results - 2" );
+ "test_floatValue - 2" );
}
public void test_doubleValue( )
{
@@ -192,10 +192,10 @@
Long b2 = new Long(30);
harness.check(!( b1.doubleValue() != 0.0 ),
- "Error: test_doubleValue returned wrong results - 1" );
+ "test_doubleValue - 1" );
harness.check(!( b2.doubleValue() != 30.0 ),
- "Error: test_doubleValue returned wrong results - 2" );
+ "test_doubleValue - 2" );
}
public void test_toHexString()
@@ -206,10 +206,10 @@
str1 = Long.toHexString( -5361 );
harness.check(!( !str.equalsIgnoreCase("20B7")),
- "Error: test_toHexString returned wrong results - 1" );
+ "test_toHexString - 1" );
harness.check(!( !str1.equalsIgnoreCase("ffffffffffffeb0f")),
- "Error: test_toHexString returned wrong results - 2" );
+ "test_toHexString - 2" );
}
public void test_toOctalString()
@@ -219,55 +219,55 @@
str1= Long.toOctalString(-9863 );
harness.check(!( !str.equals("13327")),
- "Error: test_toOctalString returned wrong results - 1" );
+ "test_toOctalString - 1" );
harness.check(!( !str1.equals("1777777777777777754571")),
- "Error: test_toOctalString returned wrong results - 2" );
+ "test_toOctalString - 2" );
}
public void test_toBinaryString()
{
String str1 = Long.toBinaryString( -5478 );
harness.check(!( !Long.toBinaryString(358).equals("101100110")),
- "Error: test_toBinaryString returned wrong results - 1" );
+ "test_toBinaryString - 1" );
harness.check(!( !str1.equals("1111111111111111111111111111111111111111111111111110101010011010")),
- "Error: test_toBinaryString returned wrong results - 2" );
+ "test_toBinaryString - 2" );
}
public void test_parseLong()
{
harness.check(!( Long.parseLong("473") != Long.parseLong("473" , 10 )),
- "Error: test_parseLong returned wrong results - 1" );
+ "test_parseLong - 1" );
harness.check(!( Long.parseLong("0" , 10 ) != 0L ),
- "Error: test_parseLong returned wrong results - 2" );
+ "test_parseLong - 2" );
harness.check(!( Long.parseLong("473" , 10 ) != 473L ),
- "Error: test_parseLong returned wrong results - 3" );
+ "test_parseLong - 3" );
harness.check(!( Long.parseLong("-0" , 10 ) != 0L ),
- "Error: test_parseLong returned wrong results - 4" );
+ "test_parseLong - 4" );
harness.check(!( Long.parseLong("-FF" , 16 ) != -255L ),
- "Error: test_parseLong returned wrong results - 5" );
+ "test_parseLong - 5" );
harness.check(!( Long.parseLong("1100110" , 2 ) != 102L ),
- "Error: test_parseLong returned wrong results - 6" );
+ "test_parseLong - 6" );
harness.check(!( Long.parseLong("2147483647" , 10 ) != 2147483647L ),
- "Error: test_parseLong returned wrong results - 7" );
+ "test_parseLong - 7" );
harness.check(!( Long.parseLong("-2147483647" , 10 ) != -2147483647L ),
- "Error: test_parseLong returned wrong results - 8" );
+ "test_parseLong - 8" );
try {
Long.parseLong("99" , 8 );
- harness.fail("Error: test_parseLong returned wrong results - 10" );
+ harness.fail("test_parseLong - 10" );
}catch ( NumberFormatException e ){}
try {
Long.parseLong("Hazelnut" , 10 );
- harness.fail("Error: test_parseLong returned wrong results - 11" );
+ harness.fail("test_parseLong - 11" );
}catch ( NumberFormatException e ){}
harness.check(!( Long.parseLong("Hazelnut" , 36 ) != 1356099454469L ),
- "Error: test_parseLong returned wrong results - 12" );
+ "test_parseLong - 12" );
long_hex_ok("-8000000000000000", -0x8000000000000000L);
@@ -316,7 +316,7 @@
static void long_hex_bad(String s) {
try {
Long.parseLong(s, 16);
- harness.fail("Error long_hex_bad " +
+ harness.fail("long_hex_bad " +
s + " should not be valid!" );
} catch (NumberFormatException e ){
}
@@ -351,9 +351,9 @@
public void test_valueOf( )
{
harness.check(!( Long.valueOf("21234").longValue() != Long.parseLong("21234")),
- "Error: test_valueOf returned wrong results - 1" );
+ "test_valueOf - 1" );
harness.check(!( Long.valueOf("Kona", 27).longValue() != Long.parseLong("Kona", 27)),
- "Error: test_valueOf returned wrong results - 2" );
+ "test_valueOf - 2" );
}
public void test_getLong( )
@@ -395,11 +395,11 @@
try {
harness.check(!( Long.getLong("longkey7", new Long(0)).longValue() != 0 ),
- "Error: test_getLong returned wrong results - 3" );
+ "test_getLong - 3" );
} catch (NullPointerException npe) { harness.check(false); }
try {
harness.check(!( Long.getLong("longkey7", 0).longValue() != 0 ),
- "Error: test_getLong returned wrong results - 4" );
+ "test_getLong - 4" );
} catch (NullPointerException npe) { harness.check(false); }
}
Index: ./gnu/testlet/java/lang/Math/MathTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Math/MathTest.java,v
retrieving revision 1.3
diff -u -u -r1.3 MathTest.java
--- ./gnu/testlet/java/lang/Math/MathTest.java 21 Feb 2005 15:52:47 -0000 1.3
+++ ./gnu/testlet/java/lang/Math/MathTest.java 22 Jan 2006 21:14:49 -0000
@@ -31,253 +31,253 @@
public void test_Basics()
{
harness.check(!( Math.E != 2.7182818284590452354 ),
- "Error : test_Basics failed - 1");
+ "test_Basics - 1");
harness.check(!( Math.PI != 3.14159265358979323846 ),
- "Error : test_Basics failed - 2");
+ "test_Basics - 2");
}
public void test_sincostan()
{
harness.check(!( !(new Double(Math.sin( Double.NaN ))).isNaN() ),
- "Error : test_sincostan failed - 1");
+ "test_sincostan - 1");
harness.check(!( !(new Double(Math.sin( Double.POSITIVE_INFINITY ))).isNaN() ),
- "Error : test_sincostan failed - 2");
+ "test_sincostan - 2");
harness.check(!( !(new Double(Math.sin( Double.NEGATIVE_INFINITY ))).isNaN() ),
- "Error : test_sincostan failed - 3");
+ "test_sincostan - 3");
harness.check(!( Math.sin( -0.0 ) != -0.0 ),
- "Error : test_sincostan failed - 4");
+ "test_sincostan - 4");
harness.check(!( Math.sin( 0.0 ) != 0.0 ),
- "Error : test_sincostan failed - 5");
+ "test_sincostan - 5");
harness.check(!( !(new Double(Math.cos( Double.NaN ))).isNaN() ),
- "Error : test_sincostan failed - 6");
+ "test_sincostan - 6");
harness.check(!( !(new Double(Math.cos( Double.POSITIVE_INFINITY ))).isNaN() ),
- "Error : test_sincostan failed - 7");
+ "test_sincostan - 7");
harness.check(!( !(new Double(Math.cos( Double.NEGATIVE_INFINITY ))).isNaN() ),
- "Error : test_sincostan failed - 8");
+ "test_sincostan - 8");
harness.check(!( !(new Double(Math.tan( Double.NaN ))).isNaN() ),
- "Error : test_sincostan failed - 9");
+ "test_sincostan - 9");
harness.check(!( !(new Double(Math.tan( Double.POSITIVE_INFINITY ))).isNaN() ),
- "Error : test_sincostan failed - 10");
+ "test_sincostan - 10");
harness.check(!( !(new Double(Math.tan( Double.NEGATIVE_INFINITY ))).isNaN()),
- "Error : test_sincostan failed - 11");
+ "test_sincostan - 11");
harness.check(!( Math.tan( -0.0 ) != -0.0 ),
- "Error : test_sincostan failed - 12");
+ "test_sincostan - 12");
harness.check(!( Math.tan( 0.0 ) != 0.0 ),
- "Error : test_sincostan failed - 13");
+ "test_sincostan - 13");
harness.check(!( Math.sin( Math.PI / 2.0 + Math.PI /6.0 ) <= 0.0 ),
- "Error : test_sincostan failed - 14");
+ "test_sincostan - 14");
harness.check(!( Math.cos( Math.PI / 2.0 + Math.PI /6.0 ) >= 0.0 ),
- "Error : test_sincostan failed - 14");
+ "test_sincostan - 14");
harness.check(!( Math.tan( Math.PI / 2.0 + Math.PI /6.0 ) >= 0.0 ),
- "Error : test_sincostan failed - 14");
+ "test_sincostan - 14");
}
public void test_asinacosatan()
{
harness.check(!( !(new Double(Math.asin( Double.NaN ))).isNaN() ),
- "Error : test_asinacosatan failed - 1");
+ "test_asinacosatan - 1");
harness.check(!( Math.asin( -0.0 ) != -0.0 ),
- "Error : test_asinacosatan failed - 2");
+ "test_asinacosatan - 2");
harness.check(!( Math.asin( 0.0 ) != 0.0 ),
- "Error : test_asinacosatan failed - 3");
+ "test_asinacosatan - 3");
harness.check(!( !(new Double(Math.asin( 10.0 ))).isNaN() ),
- "Error : test_asinacosatan failed - 4");
+ "test_asinacosatan - 4");
harness.check(!( !(new Double(Math.acos( Double.NaN ))).isNaN() ),
- "Error : test_asinacosatan failed - 5");
+ "test_asinacosatan - 5");
harness.check(!( !(new Double(Math.acos( 10.0 ))).isNaN() ),
- "Error : test_asinacosatan failed - 6");
+ "test_asinacosatan - 6");
harness.check(!( !(new Double(Math.atan( Double.NaN ))).isNaN() ),
- "Error : test_asinacosatan failed - 7");
+ "test_asinacosatan - 7");
harness.check(!( Math.atan( -0.0 ) != -0.0 ),
- "Error : test_asinacosatan failed - 8");
+ "test_asinacosatan - 8");
harness.check(!( Math.atan( 0.0 ) != 0.0 ),
- "Error : test_asinacosatan failed - 9");
+ "test_asinacosatan - 9");
}
public void test_atan2()
{
harness.check(!(!(new Double( Math.atan2 (1.0 , Double.NaN ))).isNaN()),
- "Error : test_atan2 failed - 1");
+ "test_atan2 - 1");
harness.check(!(!(new Double( Math.atan2 (Double.NaN,1.0 ))).isNaN()),
- "Error : test_atan2 failed - 2");
+ "test_atan2 - 2");
harness.check(!(( Math.atan2(0.0, 10.0 ) != -0.0 ) ||
( Math.atan2(2.0 , Double.POSITIVE_INFINITY ) != -0.0 )),
- "Error : test_atan2 failed - 3");
+ "test_atan2 - 3");
harness.check(!(( Math.atan2(-0.0, 10.0 ) != -0.0 ) ||
( Math.atan2(-2.0 , Double.POSITIVE_INFINITY ) != -0.0 )),
- "Error : test_atan2 failed - 4");
+ "test_atan2 - 4");
harness.check(!(( Math.atan2(0.0, -10.0 ) != Math.PI) ||
( Math.atan2(2.0 , Double.NEGATIVE_INFINITY ) != Math.PI )),
- "Error : test_atan2 failed - 4");
+ "test_atan2 - 4");
harness.check(!(( Math.atan2(-0.0, -10.0 ) != -Math.PI) ||
( Math.atan2(-2.0 , Double.NEGATIVE_INFINITY ) != -Math.PI )),
- "Error : test_atan2 failed - 5");
+ "test_atan2 - 5");
harness.check(!(( Math.atan2(10.0, 0.0 ) != Math.PI/2.0) ||
( Math.atan2(Double.POSITIVE_INFINITY , 3.0) != Math.PI /2.0)),
- "Error : test_atan2 failed - 6");
+ "test_atan2 - 6");
harness.check(!(( Math.atan2(-10.0, 0.0 ) != -Math.PI/2.0) ||
( Math.atan2(Double.NEGATIVE_INFINITY , 3.0) != -Math.PI /2.0)),
- "Error : test_atan2 failed - 7");
+ "test_atan2 - 7");
harness.check(!(( Math.atan2(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY ) != Math.PI/4.0)),
- "Error : test_atan2 failed - 8");
+ "test_atan2 - 8");
harness.check(!(( Math.atan2(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY ) != Math.PI*3.0/4.0)),
- "Error : test_atan2 failed - 9");
+ "test_atan2 - 9");
harness.check(!(( Math.atan2(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY ) != -Math.PI/4.0)),
- "Error : test_atan2 failed - 10");
+ "test_atan2 - 10");
harness.check(!(( Math.atan2(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY ) != -Math.PI*3.0/4.0)),
- "Error : test_atan2 failed - 11");
+ "test_atan2 - 11");
}
public void test_exp()
{
harness.check(!( !(new Double(Math.exp( Double.NaN ))).isNaN() ),
- "Error : test_exp failed - 1");
+ "test_exp - 1");
harness.check(!( !(new Double(Math.exp( Double.POSITIVE_INFINITY))).isInfinite() ),
- "Error : test_exp failed - 2");
+ "test_exp - 2");
harness.check(!( Math.exp( Double.NEGATIVE_INFINITY) != 0.0 ),
- "Error : test_exp failed - 3");
+ "test_exp - 3");
}
public void test_log()
{
harness.check(!( !(new Double(Math.log( Double.NaN ))).isNaN() ),
- "Error : test_log failed - 1");
+ "test_log - 1");
harness.check(!( !(new Double(Math.log( -1.0 ))).isNaN() ),
- "Error : test_log failed - 2");
+ "test_log - 2");
harness.check(!( !(new Double(Math.log( Double.POSITIVE_INFINITY ))).isInfinite() ),
- "Error : test_log failed - 3");
+ "test_log - 3");
}
public void test_sqrt()
{
harness.check(!( !(new Double(Math.sqrt( Double.NaN ))).isNaN() ||
!(new Double(Math.sqrt( -10.0 ))).isNaN()),
- "Error : test_sqrt failed - 1");
+ "test_sqrt - 1");
harness.check(!( !(new Double(Math.sqrt( Double.NaN ))).isNaN() ||
!(new Double(Math.sqrt( -10.0 ))).isNaN()),
- "Error : test_sqrt failed - 2");
+ "test_sqrt - 2");
harness.check(!( !(new Double(Math.sqrt( Double.POSITIVE_INFINITY))).isInfinite()),
- "Error : test_sqrt failed - 3");
+ "test_sqrt - 3");
harness.check(!( Math.sqrt( -0.0) != -0.0 || Math.sqrt( 0.0) != 0.0 ),
- "Error : test_sqrt failed - 4");
+ "test_sqrt - 4");
harness.check(!( Math.sqrt( -0.0) != -0.0 || Math.sqrt( 0.0) != 0.0 ),
- "Error : test_sqrt failed - 5");
+ "test_sqrt - 5");
double sq = Math.sqrt(4.0);
harness.check(!(!( sq >= 1.9999 && sq <= 2.111 )),
- "Error : test_sqrt failed - 6");
+ "test_sqrt - 6");
}
public void test_pow()
{
harness.check(!( Math.pow(1.0 , 0.0 ) != 1.0 ),
- "Error : test_pow failed - 1");
+ "test_pow - 1");
harness.check(!( Math.pow(2.0 , -0.0 ) != 1.0 ),
- "Error : test_pow failed - 2");
+ "test_pow - 2");
harness.check(!( Math.pow(123.0 , 1.0 ) != 123.0 ),
- "Error : test_pow failed - 3");
+ "test_pow - 3");
harness.check(!( !(new Double(Math.pow( 10.0, Double.NaN ))).isNaN()),
- "Error : test_pow failed - 4");
+ "test_pow - 4");
harness.check(!( !(new Double(Math.pow( Double.NaN, 1.0 ))).isNaN()),
- "Error : test_pow failed - 5");
+ "test_pow - 5");
harness.check(!( !(new Double(Math.pow( 2.0, Double.POSITIVE_INFINITY ))).isInfinite()),
- "Error : test_pow failed - 6");
+ "test_pow - 6");
harness.check(!( !(new Double(Math.pow( 0.5, Double.NEGATIVE_INFINITY ))).isInfinite()),
- "Error : test_pow failed - 7");
+ "test_pow - 7");
harness.check(!( Math.pow( 1.5, Double.NEGATIVE_INFINITY ) != 0.0 ||
Math.pow( 0.5, Double.POSITIVE_INFINITY ) != 0.0),
- "Error : test_pow failed - 8");
+ "test_pow - 8");
harness.check(!( !(new Double(Math.pow( 1.0, Double.POSITIVE_INFINITY ))).isNaN()),
- "Error : test_pow failed - 9");
+ "test_pow - 9");
harness.check(!( Math.pow( 0.0, 1.0) != 0.0 ||
Math.pow( Double.POSITIVE_INFINITY , -1.0 ) != 0.0),
- "Error : test_pow failed - 10");
+ "test_pow - 10");
harness.check(!( !(new Double(Math.pow( 0.0, -1.0 ))).isInfinite() ||
!(new Double(Math.pow( Double.POSITIVE_INFINITY, 1.0 ))).isInfinite() ),
- "Error : test_pow failed - 11");
+ "test_pow - 11");
harness.check(!( Math.pow( -0.0, 5.0) != -0.0 ||
Math.pow( Double.NEGATIVE_INFINITY , -7.0 ) != -0.0),
- "Error : test_pow failed - 12");
+ "test_pow - 12");
harness.check(!( Math.pow( -2.0, 6.0) != Math.pow(2.0,6.0)),
- "Error : test_pow failed - 13");
+ "test_pow - 13");
harness.check(!( Math.pow( -2.0, 5.0) != -Math.pow(2.0,5.0)),
- "Error : test_pow failed - 14");
+ "test_pow - 14");
}
public void test_IEEEremainder()
{
harness.check(!( !(new Double(Math.IEEEremainder( Double.NaN, 1.0 ))).isNaN()),
- "Error : test_IEEEremainder failed - 1");
+ "test_IEEEremainder - 1");
harness.check(!( !(new Double(Math.IEEEremainder( 1.0,Double.NaN))).isNaN()),
- "Error : test_IEEEremainder failed - 2");
+ "test_IEEEremainder - 2");
harness.check(!( !(new Double(Math.IEEEremainder( Double.POSITIVE_INFINITY , 2.0))).isNaN()),
- "Error : test_IEEEremainder failed - 3");
+ "test_IEEEremainder - 3");
harness.check(!( !(new Double(Math.IEEEremainder( 2.0,0.0))).isNaN() ),
- "Error : test_IEEEremainder failed - 4");
+ "test_IEEEremainder - 4");
harness.check(!( Math.IEEEremainder( 3.0, Double.POSITIVE_INFINITY ) != 3.0 ),
- "Error : test_IEEEremainder failed - 5");
+ "test_IEEEremainder - 5");
}
public void test_ceil()
{
harness.check(!( Math.ceil(5.0) != 5.0 ),
- "Error : test_ceil failed - 1");
+ "test_ceil - 1");
harness.check(!( Math.ceil(0.0) != 0.0 || Math.ceil(-0.0) != -0.0 ),
- "Error : test_ceil failed - 2");
+ "test_ceil - 2");
harness.check(!( !(new Double(Math.ceil(Double.POSITIVE_INFINITY))).isInfinite() ||
!(new Double(Math.ceil(Double.NaN))).isNaN()),
- "Error : test_ceil failed - 3");
+ "test_ceil - 3");
harness.check(!( Math.ceil(-0.5) != -0.0 ),
- "Error : test_ceil failed - 4");
+ "test_ceil - 4");
harness.check(!( Math.ceil( 2.5 ) != 3.0 ),
- "Error : test_ceil failed - 5");
+ "test_ceil - 5");
}
@@ -285,268 +285,268 @@
public void test_floor()
{
harness.check(!( Math.floor(5.0) != 5.0 ),
- "Error : test_floor failed - 1");
+ "test_floor - 1");
harness.check(!( Math.floor(2.5) != 2.0 ),
- "Error : test_floor failed - 2");
+ "test_floor - 2");
harness.check(!( !(new Double(Math.floor(Double.POSITIVE_INFINITY))).isInfinite() ||
!(new Double(Math.floor(Double.NaN))).isNaN()),
- "Error : test_floor failed - 3");
+ "test_floor - 3");
harness.check(!( Math.floor(0.0) != 0.0 || Math.floor(-0.0) != -0.0 ),
- "Error : test_floor failed - 4");
+ "test_floor - 4");
}
public void test_rint()
{
harness.check(!( Math.rint( 2.3 ) != 2.0 ),
- "Error : test_rint failed - 1");
+ "test_rint - 1");
harness.check(!( Math.rint( 2.7 ) != 3.0 ),
- "Error : test_rint failed - 2");
+ "test_rint - 2");
harness.check(!(Math.rint( 2.5) != 2.0 ),
- "Error : test_rint failed - 3");
+ "test_rint - 3");
harness.check(!( Math.rint( 2.0) != 2.0 ),
- "Error : test_rint failed - 4");
+ "test_rint - 4");
harness.check(!( Math.rint( 2.0) != 2.0 ),
- "Error : test_rint failed - 5");
+ "test_rint - 5");
harness.check(!( !(new Double(Math.rint(Double.POSITIVE_INFINITY))).isInfinite() ||
!(new Double(Math.rint(Double.NaN))).isNaN()),
- "Error : test_rint failed - 6");
+ "test_rint - 6");
harness.check(!( Math.rint(0.0) != 0.0 || Math.rint(-0.0) != -0.0 ),
- "Error : test_rint failed - 7");
+ "test_rint - 7");
}
public void test_round()
{
harness.check(!( Math.round( 3.4 ) != 3 ),
- "Error : test_round failed - 1");
+ "test_round - 1");
harness.check(!( Math.round( 9.55 ) != 10 ),
- "Error : test_round failed - 2");
+ "test_round - 2");
harness.check(!( Math.round(Double.NaN) != 0 ),
- "Error : test_round failed - 3");
+ "test_round - 3");
float f1 = Integer.MIN_VALUE;
f1 -= 5;
harness.check(!( Math.round(f1) != Integer.MIN_VALUE ||
Math.round(Float.NEGATIVE_INFINITY) != Integer.MIN_VALUE ),
- "Error : test_round failed - 4");
+ "test_round - 4");
f1 = Integer.MAX_VALUE;
f1 += 5;
harness.check(!( Math.round(f1) != Integer.MAX_VALUE ||
Math.round(Float.POSITIVE_INFINITY) != Integer.MAX_VALUE ),
- "Error : test_round failed - 5");
+ "test_round - 5");
double d1 = Long.MIN_VALUE;
d1 -= 5;
harness.check(!( Math.round(d1) != Long.MIN_VALUE ||
Math.round(Double.NEGATIVE_INFINITY) != Long.MIN_VALUE ),
- "Error : test_round failed - 6");
+ "test_round - 6");
d1 = Long.MAX_VALUE;
d1 += 5;
harness.check(!( Math.round(d1) != Long.MAX_VALUE ||
Math.round(Double.POSITIVE_INFINITY) != Long.MAX_VALUE ),
- "Error : test_round failed - 7");
+ "test_round - 7");
harness.check(!( Math.round( 3.4f ) != 3 ),
- "Error : test_round failed - 8");
+ "test_round - 8");
harness.check(!( Math.round( 9.55f ) != 10 ),
- "Error : test_round failed - 9");
+ "test_round - 9");
harness.check(!( Math.round(Float.NaN) != 0 ),
- "Error : test_round failed - 10");
+ "test_round - 10");
}
public void test_random()
{
harness.check(!( Math.random() < 0.0 || Math.random() > 1.0 ),
- "Error : test_random failed - 1");
+ "test_random - 1");
}
public void test_abs()
{
harness.check(!( Math.abs( 10 ) != 10 ),
- "Error : test_abs failed - 1");
+ "test_abs - 1");
harness.check(!( Math.abs( -23 ) != 23 ),
- "Error : test_abs failed - 2");
+ "test_abs - 2");
harness.check(!( Math.abs( Integer.MIN_VALUE ) != Integer.MIN_VALUE ),
- "Error : test_abs failed - 3" );
+ "test_abs - 3" );
harness.check(!( Math.abs(-0) != 0 ),
- "Error : test_abs failed - 4" );
+ "test_abs - 4" );
harness.check(!( Math.abs( 1000L ) != 1000 ),
- "Error : test_abs failed - 5");
+ "test_abs - 5");
harness.check(!( Math.abs( -2334242L ) != 2334242 ),
- "Error : test_abs failed - 6");
+ "test_abs - 6");
harness.check(!( Math.abs( Long.MIN_VALUE ) != Long.MIN_VALUE ),
- "Error : test_abs failed - 7" );
+ "test_abs - 7" );
harness.check(!( Math.abs( 0.0f ) != 0.0f || Math.abs(-0.0f) != 0.0f ),
- "Error : test_abs failed - 8" );
+ "test_abs - 8" );
harness.check(!( !(new Float(Math.abs( Float.POSITIVE_INFINITY ))).isInfinite() ),
- "Error : test_abs failed - 9" );
+ "test_abs - 9" );
harness.check(!( !(new Float(Math.abs( Float.NaN ))).isNaN() ),
- "Error : test_abs failed - 10" );
+ "test_abs - 10" );
harness.check(!( Math.abs( 23.34f ) != 23.34f ),
- "Error : test_abs failed - 11" );
+ "test_abs - 11" );
harness.check(!( Math.abs( 0.0 ) != 0.0 || Math.abs(-0.0) != 0.0 ),
- "Error : test_abs failed - 12" );
+ "test_abs - 12" );
harness.check(!( !(new Double(Math.abs( Double.POSITIVE_INFINITY ))).isInfinite() ),
- "Error : test_abs failed - 13" );
+ "test_abs - 13" );
harness.check(!( !(new Double(Math.abs( Double.NaN ))).isNaN() ),
- "Error : test_abs failed - 14" );
+ "test_abs - 14" );
harness.check(!( Math.abs( 23.34 ) != 23.34 ),
- "Error : test_abs failed - 15" );
+ "test_abs - 15" );
}
public void test_min()
{
harness.check(!( Math.min( 100 , 12 ) != 12 ),
- "Error : test_min failed - 1" );
+ "test_min - 1" );
harness.check(!( Math.min( Integer.MIN_VALUE , Integer.MIN_VALUE + 1 ) != Integer.MIN_VALUE ),
- "Error : test_min failed - 2" );
+ "test_min - 2" );
harness.check(!( Math.min( Integer.MAX_VALUE , Integer.MAX_VALUE -1 ) != Integer.MAX_VALUE -1 ),
- "Error : test_min failed - 3" );
+ "test_min - 3" );
harness.check(!( Math.min( 10 , 10 ) != 10 ),
- "Error : test_min failed - 4" );
+ "test_min - 4" );
harness.check(!( Math.min( 0 , -0 ) != -0 ),
- "Error : test_min failed - 5" );
+ "test_min - 5" );
harness.check(!( Math.min( 100L , 12L ) != 12L ),
- "Error : test_min failed - 6" );
+ "test_min - 6" );
harness.check(!( Math.min( Long.MIN_VALUE , Long.MIN_VALUE + 1 ) != Long.MIN_VALUE ),
- "Error : test_min failed - 7" );
+ "test_min - 7" );
harness.check(!( Math.min( Long.MAX_VALUE , Long.MAX_VALUE -1 ) != Long.MAX_VALUE -1 ),
- "Error : test_min failed - 8" );
+ "test_min - 8" );
harness.check(!( Math.min( 10L , 10L ) != 10L ),
- "Error : test_min failed - 9" );
+ "test_min - 9" );
harness.check(!( Math.min( 0L , -0L ) != -0L ),
- "Error : test_min failed - 10" );
+ "test_min - 10" );
harness.check(!( Math.min( 23.4f , 12.3f ) != 12.3f ),
- "Error : test_min failed - 11" );
+ "test_min - 11" );
harness.check(!( !(new Float(Math.min( Float.NaN , 1.0f ))).isNaN() ),
- "Error : test_min failed - 12" );
+ "test_min - 12" );
harness.check(!( Math.min( 10.0f , 10.0f ) != 10.0f ),
- "Error : test_min failed - 13" );
+ "test_min - 13" );
harness.check(!( Math.min( 0.0f , -0.0f ) != -0.0f ),
- "Error : test_min failed - 14" );
+ "test_min - 14" );
harness.check(!( Math.min( 23.4 , 12.3 ) != 12.3 ),
- "Error : test_min failed - 15" );
+ "test_min - 15" );
harness.check(!( !(new Double(Math.min( Double.NaN , 1.0 ))).isNaN() ),
- "Error : test_min failed - 16" );
+ "test_min - 16" );
harness.check(!( Math.min( 10.0 , 10.0 ) != 10.0 ),
- "Error : test_min failed - 17" );
+ "test_min - 17" );
harness.check(!( Math.min( 0.0 , -0.0 ) != -0.0 ),
- "Error : test_min failed - 18" );
+ "test_min - 18" );
}
public void test_max()
{
harness.check(!( Math.max( 100 , 12 ) != 100 ),
- "Error : test_max failed - 1" );
+ "test_max - 1" );
harness.check(!( Math.max( Integer.MAX_VALUE , Integer.MAX_VALUE - 1 ) != Integer.MAX_VALUE ),
- "Error : test_max failed - 2" );
+ "test_max - 2" );
harness.check(!( Math.max( Integer.MIN_VALUE , Integer.MIN_VALUE + 1 ) != Integer.MIN_VALUE +1 ),
- "Error : test_max failed - 3" );
+ "test_max - 3" );
harness.check(!( Math.max( 10 , 10 ) != 10 ),
- "Error : test_max failed - 4" );
+ "test_max - 4" );
harness.check(!( Math.max( 0 , -0 ) != 0 ),
- "Error : test_max failed - 5" );
+ "test_max - 5" );
harness.check(!( Math.max( 100L , 12L ) != 100L ),
- "Error : test_max failed - 6" );
+ "test_max - 6" );
harness.check(!( Math.max( Long.MAX_VALUE , Long.MAX_VALUE - 1 ) != Long.MAX_VALUE ),
- "Error : test_max failed - 7" );
+ "test_max - 7" );
harness.check(!( Math.max( Long.MIN_VALUE , Long.MIN_VALUE +1 ) != Long.MIN_VALUE + 1 ),
- "Error : test_max failed - 8" );
+ "test_max - 8" );
harness.check(!( Math.max( 10L , 10L ) != 10L ),
- "Error : test_max failed - 9" );
+ "test_max - 9" );
harness.check(!( Math.max( 0L , -0L ) != 0L ),
- "Error : test_max failed - 10" );
+ "test_max - 10" );
harness.check(!( Math.max( 23.4f , 12.3f ) != 23.4f ),
- "Error : test_max failed - 11" );
+ "test_max - 11" );
harness.check(!( !(new Float(Math.max( Float.NaN , 1.0f ))).isNaN() ),
- "Error : test_max failed - 12" );
+ "test_max - 12" );
harness.check(!( Math.max( 10.0f , 10.0f ) != 10.0f ),
- "Error : test_max failed - 13" );
+ "test_max - 13" );
harness.check(!( Math.max( 0.0f , -0.0f ) != 0.0f ),
- "Error : test_max failed - 14" );
+ "test_max - 14" );
harness.check(!( Math.max( 23.4 , 12.3 ) != 23.4 ),
- "Error : test_max failed - 15" );
+ "test_max - 15" );
harness.check(!( !(new Double(Math.max( Double.NaN , 1.0 ))).isNaN() ),
- "Error : test_max failed - 16" );
+ "test_max - 16" );
harness.check(!( Math.max( 10.0 , 10.0 ) != 10.0 ),
- "Error : test_max failed - 17" );
+ "test_max - 17" );
harness.check(!( Math.max( 0.0 , -0.0 ) != 0.0 ),
- "Error : test_max failed - 18" );
+ "test_max - 18" );
}
Index: ./gnu/testlet/java/lang/Short/ShortTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Short/ShortTest.java,v
retrieving revision 1.3
diff -u -u -r1.3 ShortTest.java
--- ./gnu/testlet/java/lang/Short/ShortTest.java 21 Feb 2005 15:52:48 -0000 1.3
+++ ./gnu/testlet/java/lang/Short/ShortTest.java 22 Jan 2006 21:14:49 -0000
@@ -32,25 +32,25 @@
{
harness.check(!( Short.MIN_VALUE != -32768 ||
Short.MAX_VALUE != 32767 ),
- "Error: test_Basics failed - 1" );
+ "test_Basics - 1" );
Short i1 = new Short((short)100);
harness.check(!( i1.shortValue() != 100 ),
- "Error: test_Basics failed - 2" );
+ "test_Basics - 2" );
try {
harness.check(!( (new Short("234")).shortValue() != 234 ),
- "Error: test_Basics failed - 3" );
+ "test_Basics - 3" );
}
catch ( NumberFormatException e )
{
- harness.fail("Error: test_Basics failed - 3" );
+ harness.fail("test_Basics - 3" );
}
try {
harness.check(!( (new Short("-FF")).shortValue() != -255 ),
- "Error: test_Basics failed - 4" );
+ "test_Basics - 4" );
}
catch ( NumberFormatException e )
{
@@ -58,31 +58,31 @@
try {
new Short("babu");
- harness.fail("Error: test_Basics failed - 5" );
+ harness.fail("test_Basics - 5" );
}
catch ( NumberFormatException e )
{
}
harness.check(!( Short.decode( "123").shortValue() != 123 ),
- "Error: test_Basics failed - 6" );
+ "test_Basics - 6" );
harness.check(!( Short.decode( "32767").shortValue() != 32767 ),
- "Error: test_Basics failed - 7" );
+ "test_Basics - 7" );
}
public void test_toString()
{
harness.check(!( !( new Short((short)123)).toString().equals("123")),
- "Error: test_toString failed - 1" );
+ "test_toString - 1" );
harness.check(!( !( new Short((short)-44)).toString().equals("-44")),
- "Error: test_toString failed - 2" );
+ "test_toString - 2" );
harness.check(!( !Short.toString((short) 234 ).equals ("234" )),
- "Error: test_toString failed - 3" );
+ "test_toString - 3" );
harness.check(!( !Short.toString((short) -34 ).equals ("-34" )),
- "Error: test_toString failed - 4" );
+ "test_toString - 4" );
harness.check(!( !Short.toString((short) -34 ).equals ("-34" )),
- "Error: test_toString failed - 5" );
+ "test_toString - 5" );
}
@@ -92,16 +92,16 @@
Short i2 = new Short((short)-23);
harness.check(!( !i1.equals( new Short((short)23))),
- "Error: test_equals failed - 1" );
+ "test_equals - 1" );
harness.check(!( !i2.equals( new Short((short)-23))),
- "Error: test_equals failed - 2" );
+ "test_equals - 2" );
harness.check(!( i1.equals( i2 )),
- "Error: test_equals failed - 3" );
+ "test_equals - 3" );
harness.check(!( i1.equals(null)),
- "Error: test_equals failed - 4" );
+ "test_equals - 4" );
}
public void test_hashCode( )
@@ -110,7 +110,7 @@
Short b2 = new Short((short)-3439);
harness.check(!( b1.hashCode() != 3439 || b2.hashCode() != -3439 ),
- "Error: test_hashCode returned wrong results" );
+ "test_hashCode" );
}
public void test_intValue( )
@@ -119,10 +119,10 @@
Short b2 = new Short((short)-32767);
harness.check(!( b1.intValue() != 32767 ),
- "Error: test_intValue returned wrong results - 1" );
+ "test_intValue - 1" );
harness.check(!( b2.intValue() != -32767 ),
- "Error: test_intValue returned wrong results - 2" );
+ "test_intValue - 2" );
}
public void test_longValue( )
@@ -131,10 +131,10 @@
Short b2 = new Short((short)-3767);
harness.check(!( b1.longValue() != (long)3767 ),
- "Error: test_longValue returned wrong results - 1" );
+ "test_longValue - 1" );
harness.check(!( b2.longValue() != -3767 ),
- "Error: test_longValue returned wrong results - 2" );
+ "test_longValue - 2" );
}
public void test_floatValue( )
{
@@ -142,10 +142,10 @@
Short b2 = new Short((short)-3276);
harness.check(!( b1.floatValue() != 3276.0f ),
- "Error: test_floatValue returned wrong results - 1" );
+ "test_floatValue - 1" );
harness.check(!( b2.floatValue() != -3276.0f ),
- "Error: test_floatValue returned wrong results - 2" );
+ "test_floatValue - 2" );
}
public void test_doubleValue( )
{
@@ -153,10 +153,10 @@
Short b2 = new Short((short)30);
harness.check(!( b1.doubleValue() != 0.0 ),
- "Error: test_doubleValue returned wrong results - 1" );
+ "test_doubleValue - 1" );
harness.check(!( b2.doubleValue() != 30.0 ),
- "Error: test_doubleValue returned wrong results - 2" );
+ "test_doubleValue - 2" );
}
public void test_shortbyteValue( )
@@ -165,52 +165,52 @@
Short b2 = new Short((short)300);
harness.check(!( b1.byteValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 1" );
+ "test_shortbyteValue - 1" );
harness.check(!( b2.byteValue() != (byte)300 ),
- "Error: test_shortbyteValue returned wrong results - 2" );
+ "test_shortbyteValue - 2" );
harness.check(!( b1.shortValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 3" );
+ "test_shortbyteValue - 3" );
harness.check(!( b2.shortValue() != (short)300 ),
- "Error: test_shortbyteValue returned wrong results - 4" );
+ "test_shortbyteValue - 4" );
harness.check(!( ((Number)b1).shortValue() != 0 ),
- "Error: test_shortbyteValue returned wrong results - 5" );
+ "test_shortbyteValue - 5" );
harness.check(!( ((Number)b2).byteValue() != (byte)300 ),
- "Error: test_shortbyteValue returned wrong results - 6" );
+ "test_shortbyteValue - 6" );
}
public void test_parseShort()
{
harness.check(!( Short.parseShort("473") != Short.parseShort("473" , 10 )),
- "Error: test_parseInt returned wrong results - 1" );
+ "test_parseInt - 1" );
harness.check(!( Short.parseShort("0" , 10 ) != 0 ),
- "Error: test_parseInt returned wrong results - 2" );
+ "test_parseInt - 2" );
harness.check(!( Short.parseShort("473" , 10 ) != 473 ),
- "Error: test_parseInt returned wrong results - 3" );
+ "test_parseInt - 3" );
harness.check(!( Short.parseShort("-0" , 10 ) != 0 ),
- "Error: test_parseInt returned wrong results - 4" );
+ "test_parseInt - 4" );
harness.check(!( Short.parseShort("-FF" , 16 ) != -255 ),
- "Error: test_parseInt returned wrong results - 5" );
+ "test_parseInt - 5" );
harness.check(!( Short.parseShort("1100110" , 2 ) != 102 ),
- "Error: test_parseInt returned wrong results - 6" );
+ "test_parseInt - 6" );
try {
Short.parseShort("99" , 8 );
- harness.fail("Error: test_parseInt returned wrong results - 10" );
+ harness.fail("test_parseInt - 10" );
}catch ( NumberFormatException e ){}
try {
Short.parseShort("kona" , 10 );
- harness.fail("Error: test_parseInt returned wrong results - 11" );
+ harness.fail("test_parseInt - 11" );
}catch ( NumberFormatException e ){}
}
public void test_valueOf( )
{
harness.check(!( Short.valueOf("21234").intValue() != Short.parseShort("21234")),
- "Error: test_valueOf returned wrong results - 1" );
+ "test_valueOf - 1" );
}
public void testall()
Index: ./gnu/testlet/java/lang/String/StringTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/String/StringTest.java,v
retrieving revision 1.5
diff -u -u -r1.5 StringTest.java
--- ./gnu/testlet/java/lang/String/StringTest.java 21 Feb 2005 15:52:48 -0000 1.5
+++ ./gnu/testlet/java/lang/String/StringTest.java 22 Jan 2006 21:14:49 -0000
@@ -32,40 +32,40 @@
{
String str1 = new String();
harness.check(!( str1.length() != 0 ),
- "Error : test_Basics failed - 1");
+ "test_Basics - 1");
harness.check(!( !str1.toString().equals("")),
- "Error : test_Basics failed - 2");
+ "test_Basics - 2");
String str2 = new String("testing" );
harness.check(!( str2.length() != 7 ),
- "Error : test_Basics failed - 3");
+ "test_Basics - 3");
harness.check(!( !str2.toString().equals("testing")),
- "Error : test_Basics failed - 4");
+ "test_Basics - 4");
try {
String str = null;
String str3 = new String(str);
- harness.fail("Error : test_Basics failed - 5");
+ harness.fail("test_Basics - 5");
}
catch ( NullPointerException e ){}
String str4 = new String( new StringBuffer("hi there"));
harness.check(!( str4.length () != 8 ),
- "Error : test_Basics failed - 6");
+ "test_Basics - 6");
harness.check(!( !str4.toString().equals("hi there")),
- "Error : test_Basics failed - 7");
+ "test_Basics - 7");
char cdata[] = { 'h' , 'e' , 'l' , 'l' , 'o' };
String str5 = new String( cdata );
harness.check(!( str5.length () != 5 ),
- "Error : test_Basics failed - 8");
+ "test_Basics - 8");
harness.check(!( !str5.toString().equals("hello")),
- "Error : test_Basics failed - 9");
+ "test_Basics - 9");
try {
String str6 = new String( cdata , 0 , 10 );
- harness.fail("Error : test_Basics failed - 10");
+ harness.fail("test_Basics - 10");
}catch ( IndexOutOfBoundsException e )
{}
@@ -73,18 +73,18 @@
try {
byte [] barr = null;
String str7 = new String( barr , 0 , 10 );
- harness.fail("Error : test_Basics failed - 11");
+ harness.fail("test_Basics - 11");
}catch ( NullPointerException e )
{}
String str8 = new String( cdata , 0 , 4 );
harness.check(!( !str8.equals("hell")),
- "Error : test_Basics failed - 12");
+ "test_Basics - 12");
try {
String str10 = new String( null , 10 );
- harness.fail("Error : test_Basics failed - 13");
+ harness.fail("test_Basics - 13");
}catch ( NullPointerException e )
{}
@@ -97,18 +97,18 @@
byte b = (byte)(ch & 0x00ff );
harness.check(!( i != 10 || b != 'a' ),
- "Error : test_Basics failed - 14");
+ "test_Basics - 14");
byte bnull [] = null;
try {
String str11 = new String( bnull , 10 , 0 , 5);
- harness.fail("Error : test_Basics failed - 15");
+ harness.fail("test_Basics - 15");
}catch ( NullPointerException e ){}
try {
String str12 = new String( bdata , 10 , -1 , 3);
- harness.fail("Error : test_Basics failed - 16");
+ harness.fail("test_Basics - 16");
}catch ( IndexOutOfBoundsException e ){}
@@ -117,30 +117,30 @@
b = (byte)(ch & 0x00ff );
harness.check(!( i != 10 || b != 'a' ),
- "Error : test_Basics failed - 17");
+ "test_Basics - 17");
String str14 = new String( bdata);
harness.check(!( !str14.equals("dancing")),
- "Error : test_Basics failed - 18");
+ "test_Basics - 18");
// EJWcr00461
byte arr[]={(byte)'a'};
String str15 = new String(arr,0x1234,0,1);
if (!str15.equals("\u3461")) {
- harness.fail("Error : test_Basics failed - 19");
+ harness.fail("test_Basics - 19");
}
// EJWcr00462
char carr[] = {'h','e','l','l','o'};
try {
String str16 = new String(carr, Integer.MAX_VALUE, 1);
- harness.fail("Error : test_Basics failed - 20");
+ harness.fail("test_Basics - 20");
} catch (IndexOutOfBoundsException e) {
}
byte arr2[]={(byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e'};
try {
String str17 = new String(arr2,0x1234,Integer.MAX_VALUE,1);
- harness.fail("Error : test_Basics failed - 21");
+ harness.fail("test_Basics - 21");
} catch (IndexOutOfBoundsException e) {
}
@@ -154,13 +154,13 @@
String str1 = "218943289";
harness.check(!( !str1.toString().equals("218943289")),
- "Error : test_toString failed - 1");
+ "test_toString - 1");
harness.check(!( str1 != "218943289" ),
- "Error : test_toString failed - 2");
+ "test_toString - 2");
harness.check(!( !str1.equals(str1.toString())),
- "Error : test_toString failed - 3");
+ "test_toString - 3");
}
public void test_equals()
@@ -168,19 +168,19 @@
String str2 = new String("Nectar");
harness.check(!( str2.equals( null )),
- "Error : test_equals failed - 1");
+ "test_equals - 1");
harness.check(!( !str2.equals("Nectar")),
- "Error : test_equals failed - 2");
+ "test_equals - 2");
harness.check(!( str2.equals("")),
- "Error : test_equals failed - 3");
+ "test_equals - 3");
harness.check(!( str2.equals("nectar")),
- "Error : test_equals failed - 4");
+ "test_equals - 4");
harness.check(!( !"".equals("")),
- "Error : test_equals failed - 5");
+ "test_equals - 5");
}
@@ -193,33 +193,33 @@
int acthash1 = str1.hashCode();
harness.check(!( hash1 != acthash1 ),
- "Error : test_hashCode failed - 1");
+ "test_hashCode - 1");
}
public void test_length()
{
harness.check(!( "".length() != 0 ),
- "Error : test_length failed - 1");
+ "test_length - 1");
harness.check(!( "pentium".length() != 7 ),
- "Error : test_length failed - 2");
+ "test_length - 2");
}
public void test_charAt()
{
harness.check(!( "abcd".charAt(0) != 'a' || "abcd".charAt(1) != 'b' ||
"abcd".charAt(2) != 'c' || "abcd".charAt(3) != 'd' ),
- "Error : test_charAt failed - 1");
+ "test_charAt - 1");
try {
char ch = "abcd".charAt(4);
- harness.fail("Error : test_charAt failed - 2");
+ harness.fail("test_charAt - 2");
}
catch ( IndexOutOfBoundsException e ){}
try {
char ch = "abcd".charAt(-1);
- harness.fail("Error : test_charAt failed - 3");
+ harness.fail("test_charAt - 3");
}
catch ( IndexOutOfBoundsException e ){}
}
@@ -230,52 +230,52 @@
try {
str.getChars(0 , 3 , null , 1 );
- harness.fail("Error : test_getChars failed - 1");
+ harness.fail("test_getChars - 1");
}catch ( NullPointerException e ){}
char dst[] = new char[5];
try {
str.getChars(-1 , 3 , dst , 1 );
- harness.fail("Error : test_getChars failed - 2");
+ harness.fail("test_getChars - 2");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(4 , 3 , dst , 1 );
- harness.fail("Error : test_getChars failed - 3");
+ harness.fail("test_getChars - 3");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 15 , dst , 1 );
- harness.fail("Error : test_getChars failed - 4");
+ harness.fail("test_getChars - 4");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 5 , dst , -1 );
- harness.fail("Error : test_getChars failed - 5");
+ harness.fail("test_getChars - 5");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 10 , dst , 1 );
- harness.fail("Error : test_getChars failed - 6");
+ harness.fail("test_getChars - 6");
}catch ( IndexOutOfBoundsException e ){}
str.getChars(0,5,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != 'b' || dst[2] != 'c' ||
dst[3] != 'd' || dst[4] != 'e' ),
- "Error : test_getChars failed - 7");
+ "test_getChars - 7");
dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = ' ';
str.getChars(0,0,dst, 0 );
harness.check(!( dst[0] != ' ' || dst[1] != ' ' || dst[2] != ' ' ||
dst[3] != ' ' || dst[4] != ' ' ),
- "Error : test_getChars failed - 9");
+ "test_getChars - 9");
dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = ' ';
str.getChars(0,1,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != ' ' || dst[2] != ' ' ||
dst[3] != ' ' || dst[4] != ' ' ),
- "Error : test_getChars failed - 10");
+ "test_getChars - 10");
}
@@ -285,46 +285,46 @@
try {
str.getBytes(0 , 3 , null , 1 );
- harness.fail("Error : test_getBytes failed - 1");
+ harness.fail("test_getBytes - 1");
}catch ( NullPointerException e ){}
byte dst[] = new byte[5];
try {
str.getBytes(-1 , 3 , dst , 1 );
- harness.fail("Error : test_getBytes failed - 2");
+ harness.fail("test_getBytes - 2");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(4 , 3 , dst , 1 );
- harness.fail("Error : test_getBytes failed - 3");
+ harness.fail("test_getBytes - 3");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 15 , dst , 1 );
- harness.fail("Error : test_getBytes failed - 4");
+ harness.fail("test_getBytes - 4");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 5 , dst , -1 );
- harness.fail("Error : test_getBytes failed - 5");
+ harness.fail("test_getBytes - 5");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getBytes(1 , 10 , dst , 1 );
- harness.fail("Error : test_getBytes failed - 6");
+ harness.fail("test_getBytes - 6");
}catch ( IndexOutOfBoundsException e ){}
str.getBytes(0,5,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != 'b' || dst[2] != 'c' ||
dst[3] != 'd' || dst[4] != 'e' ),
- "Error : test_getBytes failed - 7");
+ "test_getBytes - 7");
byte [] dst1 = new byte[40];
dst1 = str.getBytes();
harness.check(!( dst1[0] != 'a' || dst1[1] != 'b' || dst1[2] != 'c' ||
dst1[3] != 'd' || dst1[4] != 'e' ),
- "Error : test_getBytes failed - 8");
+ "test_getBytes - 8");
}
public void test_toCharArray()
@@ -334,27 +334,27 @@
harness.check(!( charr[0] != 'a' || charr[1] != 'b' ||
charr[2] != 'c' || charr[3] != 'd' ||
charr[4] != 'e' ),
- "Error : test_toCharArray failed - 1");
+ "test_toCharArray - 1");
char [] charr1 = "".toCharArray();
harness.check(!( charr1.length > 0 ),
- "Error : test_toCharArray failed - 2");
+ "test_toCharArray - 2");
}
public void test_equalsIgnoreCase()
{
harness.check(!( "hi".equalsIgnoreCase(null)),
- "Error : test_equalsIgnoreCase failed - 1");
+ "test_equalsIgnoreCase - 1");
harness.check(!( !"hi".equalsIgnoreCase("HI")),
- "Error : test_equalsIgnoreCase failed - 2");
+ "test_equalsIgnoreCase - 2");
harness.check(!( "hi".equalsIgnoreCase("pq")),
- "Error : test_equalsIgnoreCase failed - 3");
+ "test_equalsIgnoreCase - 3");
harness.check(!( "hi".equalsIgnoreCase("HI ")),
- "Error : test_equalsIgnoreCase failed - 4");
+ "test_equalsIgnoreCase - 4");
}
@@ -362,311 +362,311 @@
{
try {
int res = "abc".compareTo(null);
- harness.fail("Error : test_compareTo failed - 1");
+ harness.fail("test_compareTo - 1");
}
catch ( NullPointerException e ){}
harness.check(!( "abc".compareTo("bcdef") >= 0 ),
- "Error : test_compareTo failed - 2");
+ "test_compareTo - 2");
harness.check(!( "abc".compareTo("abc") != 0 ),
- "Error : test_compareTo failed - 3");
+ "test_compareTo - 3");
harness.check(!( "abc".compareTo("aabc") <= 0 ),
- "Error : test_compareTo failed - 4");
+ "test_compareTo - 4");
harness.check(!( "abcd".compareTo("abc") <= 0 ),
- "Error : test_compareTo failed - 5");
+ "test_compareTo - 5");
harness.check(!( "".compareTo("abc") >= 0 ),
- "Error : test_compareTo failed - 6");
+ "test_compareTo - 6");
}
public void test_regionMatches()
{
try {
boolean res = "abc".regionMatches(0 , null , 0 , 2);
- harness.fail("Error : test_regionMatches failed - 1");
+ harness.fail("test_regionMatches - 1");
}
catch ( NullPointerException e ){}
harness.check(!( "abcd".regionMatches(-1 , "abcd" , 0 , 2 )),
- "Error : test_regionMatches failed - 2");
+ "test_regionMatches - 2");
harness.check(!( "abcd".regionMatches(0 , "abcd" , - 1 , 2 )),
- "Error : test_regionMatches failed - 3");
+ "test_regionMatches - 3");
harness.check(!( "abcd".regionMatches(0 , "abcd" , 0 , 10 )),
- "Error : test_regionMatches failed - 4");
+ "test_regionMatches - 4");
harness.check(!( "abcd".regionMatches(0 , "ab" , 0 , 3 )),
- "Error : test_regionMatches failed - 5");
+ "test_regionMatches - 5");
harness.check(!( !"abcd".regionMatches(1 , "abc" , 1 , 2 )),
- "Error : test_regionMatches failed - 6");
+ "test_regionMatches - 6");
harness.check(!( !"abcd".regionMatches(1 , "abc" , 1 , 0 )),
- "Error : test_regionMatches failed - 7");
+ "test_regionMatches - 7");
harness.check(!( "abcd".regionMatches(1 , "ABC" , 1 , 2 )),
- "Error : test_regionMatches failed - 8");
+ "test_regionMatches - 8");
try {
boolean res = "abc".regionMatches(true , 0 , null , 0 , 2);
- harness.fail("Error : test_regionMatches failed - 11");
+ harness.fail("test_regionMatches - 11");
}
catch ( NullPointerException e ){}
harness.check(!( "abcd".regionMatches(true , -1 , "abcd" , 0 , 2 )),
- "Error : test_regionMatches failed - 12");
+ "test_regionMatches - 12");
harness.check(!( "abcd".regionMatches(true , 0 , "abcd" , - 1 , 2 )),
- "Error : test_regionMatches failed - 13");
+ "test_regionMatches - 13");
harness.check(!( "abcd".regionMatches(true , 0 , "abcd" , 0 , 10 )),
- "Error : test_regionMatches failed - 14");
+ "test_regionMatches - 14");
harness.check(!( "abcd".regionMatches(true , 0 , "ab" , 0 , 3 )),
- "Error : test_regionMatches failed - 15");
+ "test_regionMatches - 15");
harness.check(!( !"abcd".regionMatches(true , 1 , "abc" , 1 , 2 )),
- "Error : test_regionMatches failed - 16");
+ "test_regionMatches - 16");
harness.check(!( !"abcd".regionMatches(true , 1 , "abc" , 1 , 0 )),
- "Error : test_regionMatches failed - 17");
+ "test_regionMatches - 17");
harness.check(!( !"abcd".regionMatches(true , 1 , "ABC" , 1 , 2 )),
- "Error : test_regionMatches failed - 18");
+ "test_regionMatches - 18");
harness.check(!( "abcd".regionMatches(false , 1 , "ABC" , 1 , 2 )),
- "Error : test_regionMatches failed - 19");
+ "test_regionMatches - 19");
}
public void test_startsWith()
{
harness.check(!( !"abcdef".startsWith( "abc")),
- "Error : test_startsWith failed - 1");
+ "test_startsWith - 1");
try {
boolean b = "abcdef".startsWith( null );
- harness.fail("Error : test_startsWith failed - 2");
+ harness.fail("test_startsWith - 2");
} catch ( NullPointerException e ){}
harness.check(!( "abcdef".startsWith( "ABC")),
- "Error : test_startsWith failed - 3");
+ "test_startsWith - 3");
harness.check(!( !"abcdef".startsWith( "")),
- "Error : test_startsWith failed - 4");
+ "test_startsWith - 4");
harness.check(!( "abc".startsWith( "abcd")),
- "Error : test_startsWith failed - 5");
+ "test_startsWith - 5");
harness.check(!( !"abcdef".startsWith( "abc" , 0 )),
- "Error : test_startsWith failed - 6");
+ "test_startsWith - 6");
try {
boolean b = "abcdef".startsWith( null ,0);
- harness.fail("Error : test_startsWith failed - 7");
+ harness.fail("test_startsWith - 7");
} catch ( NullPointerException e ){}
harness.check(!( "abcdef".startsWith( "ABC", 2)),
- "Error : test_startsWith failed - 8");
+ "test_startsWith - 8");
harness.check(!( !"abcdef".startsWith( "", 0 )),
- "Error : test_startsWith failed - 9");
+ "test_startsWith - 9");
harness.check(!( "abc".startsWith( "abcd" , 3)),
- "Error : test_startsWith failed - 10");
+ "test_startsWith - 10");
harness.check(!( "abc".startsWith( "abc" , 10)),
- "Error : test_startsWith failed - 11");
+ "test_startsWith - 11");
}
public void test_endsWith()
{
harness.check(!( !"abcdef".endsWith( "def")),
- "Error : test_endsWith failed - 1");
+ "test_endsWith - 1");
try {
boolean b = "abcdef".endsWith( null );
- harness.fail("Error : test_endsWith failed - 2");
+ harness.fail("test_endsWith - 2");
} catch ( NullPointerException e ){}
harness.check(!( "abcdef".endsWith( "DEF")),
- "Error : test_endsWith failed - 3");
+ "test_endsWith - 3");
harness.check(!( !"abcdef".endsWith( "")),
- "Error : test_endsWith failed - 4");
+ "test_endsWith - 4");
harness.check(!( "bcde".endsWith( "abcd")),
- "Error : test_endsWith failed - 5");
+ "test_endsWith - 5");
}
public void test_indexOf()
{
harness.check(!( "a".indexOf('a') != 0 ),
- "Error : test_indexOf failed - 1");
+ "test_indexOf - 1");
harness.check(!( "aabc".indexOf('c') != 3 ),
- "Error : test_indexOf failed - 2");
+ "test_indexOf - 2");
harness.check(!( "a".indexOf('c') != -1 ),
- "Error : test_indexOf failed - 3");
+ "test_indexOf - 3");
harness.check(!( "".indexOf('a') != -1 ),
- "Error : test_indexOf failed - 4");
+ "test_indexOf - 4");
harness.check(!( "abcde".indexOf('b', 3) != -1 ),
- "Error : test_indexOf failed - 5");
+ "test_indexOf - 5");
harness.check(!( "abcde".indexOf('b', 0) != 1 ),
- "Error : test_indexOf failed - 6");
+ "test_indexOf - 6");
harness.check(!( "abcdee".indexOf('e', 3) != 4 ),
- "Error : test_indexOf failed - 7");
+ "test_indexOf - 7");
harness.check(!( "abcdee".indexOf('e', 5) != 5 ),
- "Error : test_indexOf failed - 8");
+ "test_indexOf - 8");
harness.check(!( "abcdee".indexOf('e', -5) != 4 ),
- "Error : test_indexOf failed - 9");
+ "test_indexOf - 9");
harness.check(!( "abcdee".indexOf('e', 15) != -1 ),
- "Error : test_indexOf failed - 10");
+ "test_indexOf - 10");
harness.check(!( "abcdee".indexOf("babu") != -1 ),
- "Error : test_indexOf failed - 11");
+ "test_indexOf - 11");
try {
int x = "abcdee".indexOf(null);
- harness.fail("Error : test_indexOf failed - 12");
+ harness.fail("test_indexOf - 12");
}catch ( NullPointerException e ){}
harness.check(!( "abcdee".indexOf("") != 0 ),
- "Error : test_indexOf failed - 13");
+ "test_indexOf - 13");
harness.check(!( "abcdee".indexOf("ee") != 4 ),
- "Error : test_indexOf failed - 14");
+ "test_indexOf - 14");
harness.check(!( "abcbcbc".indexOf("cbc") != 2 ),
- "Error : test_indexOf failed - 15");
+ "test_indexOf - 15");
harness.check(!( "abcdee".indexOf("babu", 3) != -1 ),
- "Error : test_indexOf failed - 16");
+ "test_indexOf - 16");
try {
int x = "abcdee".indexOf(null,0);
- harness.fail("Error : test_indexOf failed - 17");
+ harness.fail("test_indexOf - 17");
}catch ( NullPointerException e ){}
harness.check(!( "abcdee".indexOf("", 0) != 0 ),
- "Error : test_indexOf failed - 18");
+ "test_indexOf - 18");
harness.check(!( "abcdee".indexOf("ee", 4) != 4 ),
- "Error : test_indexOf failed - 19");
+ "test_indexOf - 19");
harness.check(!( "abcbcbc".indexOf("cbc",4 ) != 4 ),
- "Error : test_indexOf failed - 20");
+ "test_indexOf - 20");
// EJWcr00463
if ( "hello \u5236 world".indexOf('\u5236') != 6 ) {
- harness.fail("Error : test_indexOf failed - 21");
+ harness.fail("test_indexOf - 21");
}
if ( "hello \u0645 world".indexOf('\u0645') != 6 ) {
- harness.fail("Error : test_indexOf failed - 22");
+ harness.fail("test_indexOf - 22");
}
if ( "hello \u07ff world".indexOf('\u07ff') != 6 ) {
- harness.fail("Error : test_indexOf failed - 23");
+ harness.fail("test_indexOf - 23");
}
}
public void test_lastIndexOf()
{
harness.check(!( "a".lastIndexOf('a') != 0 ),
- "Error : test_lastIndexOf failed - 1");
+ "test_lastIndexOf - 1");
harness.check(!( "aabc".lastIndexOf('c') != 3 ),
- "Error : test_lastIndexOf failed - 2");
+ "test_lastIndexOf - 2");
harness.check(!( "a".lastIndexOf('c') != -1 ),
- "Error : test_lastIndexOf failed - 3");
+ "test_lastIndexOf - 3");
harness.check(!( "".lastIndexOf('a') != -1 ),
- "Error : test_lastIndexOf failed - 4");
+ "test_lastIndexOf - 4");
harness.check(!( "abcde".lastIndexOf('b', 0) != -1 ),
- "Error : test_lastIndexOf failed - 5");
+ "test_lastIndexOf - 5");
harness.check(!( "abcde".lastIndexOf('b', 4) != 1 ),
- "Error : test_lastIndexOf failed - 6");
+ "test_lastIndexOf - 6");
harness.check(!( "abcdee".lastIndexOf('e', 7) != 5 ),
- "Error : test_lastIndexOf failed - 7");
+ "test_lastIndexOf - 7");
harness.check(!( "abcdee".lastIndexOf('e', 5) != 5 ),
- "Error : test_lastIndexOf failed - 8");
+ "test_lastIndexOf - 8");
harness.check(!( "abcdee".lastIndexOf('e', -5) != -1 ),
- "Error : test_lastIndexOf failed - 9");
+ "test_lastIndexOf - 9");
harness.check(!( "abcdee".lastIndexOf('e', 15) != 5 ),
- "Error : test_lastIndexOf failed - 10");
+ "test_lastIndexOf - 10");
harness.check(!( "abcdee".lastIndexOf("babu") != -1 ),
- "Error : test_lastIndexOf failed - 11");
+ "test_lastIndexOf - 11");
try {
int x = "abcdee".lastIndexOf(null);
- harness.fail("Error : test_lastIndexOf failed - 12");
+ harness.fail("test_lastIndexOf - 12");
}catch ( NullPointerException e ){}
harness.check(!( "abcdee".lastIndexOf("") != 6 ),
- "Error : test_lastIndexOf failed - 13");
+ "test_lastIndexOf - 13");
harness.check(!( "abcdee".lastIndexOf("ee") != 4 ),
- "Error : test_lastIndexOf failed - 14");
+ "test_lastIndexOf - 14");
harness.check(!( "abcbcbc".lastIndexOf("cbc") != 4 ),
- "Error : test_lastIndexOf failed - 15");
+ "test_lastIndexOf - 15");
harness.check(!( "abcdee".lastIndexOf("babu", 3) != -1 ),
- "Error : test_lastIndexOf failed - 16");
+ "test_lastIndexOf - 16");
try {
int x = "abcdee".lastIndexOf(null,0);
- harness.fail("Error : test_lastIndexOf failed - 17");
+ harness.fail("test_lastIndexOf - 17");
}catch ( NullPointerException e ){}
harness.check(!( "abcdee".lastIndexOf("", 0) != 0 ),
- "Error : test_lastIndexOf failed - 18");
+ "test_lastIndexOf - 18");
harness.check(!( "abcdee".lastIndexOf("ee", 4) != 4 ),
- "Error : test_lastIndexOf failed - 19");
+ "test_lastIndexOf - 19");
harness.check(!( "abcbcbc".lastIndexOf("cbc",3 ) != 2 ),
- "Error : test_lastIndexOf failed - 20");
+ "test_lastIndexOf - 20");
}
public void test_substring()
{
harness.check(!( !"unhappy".substring(2).equals("happy")),
- "Error : test_substring failed - 1");
+ "test_substring - 1");
harness.check(!( !"Harbison".substring(3).equals("bison")),
- "Error : test_substring failed - 2");
+ "test_substring - 2");
harness.check(!( !"emptiness".substring(9).equals("")),
- "Error : test_substring failed - 3");
+ "test_substring - 3");
try {
String str = "hi there".substring(-1);
- harness.fail("Error : test_substring failed - 4");
+ harness.fail("test_substring - 4");
}catch( IndexOutOfBoundsException e ){}
try {
String str = "hi there".substring(10);
- harness.fail("Error : test_substring failed - 5");
+ harness.fail("test_substring - 5");
}catch( IndexOutOfBoundsException e ){}
harness.check(!( !"hamburger".substring(4,8).equals("urge")),
- "Error : test_substring failed - 6");
+ "test_substring - 6");
harness.check(!( !"smiles".substring(1,5).equals("mile")),
- "Error : test_substring failed - 7");
+ "test_substring - 7");
harness.check(!( !"emptiness".substring(2,2).equals("")),
- "Error : test_substring failed - 8");
+ "test_substring - 8");
try {
String str = "hi there".substring(-1, 3);
- harness.fail("Error : test_substring failed - 9");
+ harness.fail("test_substring - 9");
}catch( IndexOutOfBoundsException e ){}
try {
String str = "hi there".substring(0, 10);
- harness.fail("Error : test_substring failed - 10");
+ harness.fail("test_substring - 10");
}catch( IndexOutOfBoundsException e ){}
try {
String str = "hi there".substring(7, 6);
- harness.fail("Error : test_substring failed - 11");
+ harness.fail("test_substring - 11");
}catch( IndexOutOfBoundsException e ){}
@@ -676,31 +676,31 @@
{
try {
String str = "help".concat(null);
- harness.fail("Error : test_concat failed - 1");
+ harness.fail("test_concat - 1");
}catch ( NullPointerException e){}
harness.check(!( !"help".concat("me").equals("helpme")),
- "Error : test_concat failed - 2");
+ "test_concat - 2");
harness.check(!( ! "to".concat("get").concat("her").equals("together")),
- "Error : test_concat failed - 3");
+ "test_concat - 3");
harness.check(!( "hi".concat("") != "hi"),
- "Error : test_concat failed - 4");
+ "test_concat - 4");
String str1 = "".concat("there");
harness.check(!( !str1.equals("there")),
- "Error : test_concat failed - 5");
+ "test_concat - 5");
// EJWcr00467
String str2 = new String();
try {
str2 = str2.concat("hello");
if (!str2.equals("hello")) {
- harness.fail("Error : test_concat failed - 7");
+ harness.fail("test_concat - 7");
}
} catch (Exception e) {
- harness.fail("Error : test_concat failed - 6");
+ harness.fail("test_concat - 6");
}
}
@@ -709,28 +709,28 @@
{
harness.check(!( !"mesquite in your cellar".replace('e' , 'o' ).equals(
"mosquito in your collar" )),
- "Error : test_replace failed - 1");
+ "test_replace - 1");
harness.check(!( !"the war of baronets".replace('r' , 'y' ).equals(
"the way of bayonets" )),
- "Error : test_replace failed - 2");
+ "test_replace - 2");
harness.check(!( !"sparring with a purple porpoise".replace('p' , 't' ).equals(
"starring with a turtle tortoise" )),
- "Error : test_replace failed - 3");
+ "test_replace - 3");
harness.check(!( !"JonL".replace('q' , 'x' ).equals("JonL" )),
- "Error : test_replace failed - 4");
+ "test_replace - 4");
harness.check(!( !"ppppppppppppp".replace('p' , 'p' ).equals("ppppppppppppp")),
- "Error : test_replace failed - 5");
+ "test_replace - 5");
harness.check(!( !"ppppppppppppp".replace('p' , '1' ).equals("1111111111111")),
- "Error : test_replace failed - 6");
+ "test_replace - 6");
harness.check(!( !"hp".replace('c' , 'd' ).equals("hp")),
- "Error : test_replace failed - 7");
+ "test_replace - 7");
harness.check(!( !"vmhere".replace('a' , 'd' ).equals("vmhere")),
- "Error : test_replace failed - 8");
+ "test_replace - 8");
}
@@ -738,41 +738,41 @@
public void test_toLowerCase()
{
harness.check(!( !"".toLowerCase().equals("")),
- "Error : test_toLowerCase failed - 1");
+ "test_toLowerCase - 1");
harness.check(!( !"French Fries".toLowerCase().equals("french fries")),
- "Error : test_toLowerCase failed - 2");
+ "test_toLowerCase - 2");
harness.check(!( !"SMALL-VM".toLowerCase().equals("small-vm")),
- "Error : test_toLowerCase failed - 3");
+ "test_toLowerCase - 3");
}
public void test_toUpperCase()
{
harness.check(!( !"".toUpperCase().equals("")),
- "Error : test_toUpperCase failed - 1");
+ "test_toUpperCase - 1");
harness.check(!( !"French Fries".toUpperCase().equals("FRENCH FRIES")),
- "Error : test_toUpperCase failed - 2");
+ "test_toUpperCase - 2");
harness.check(!( !"SMALL-VM".toUpperCase().equals("SMALL-VM")),
- "Error : test_toUpperCase failed - 3");
+ "test_toUpperCase - 3");
harness.check(!( !"small-jvm".toUpperCase().equals("SMALL-JVM")),
- "Error : test_toUpperCase failed - 4");
+ "test_toUpperCase - 4");
}
public void test_valueOf()
{
harness.check(!( !String.valueOf((Object)null).equals("null")),
- "Error : test_valueOf failed - 1");
+ "test_valueOf - 1");
Object obj = new Object();
harness.check(!( !String.valueOf(obj).equals(obj.toString())),
- "Error : test_valueOf failed - 2");
+ "test_valueOf - 2");
try {
@@ -782,60 +782,60 @@
char [] data = { 'h' , 'e' , 'l' , 'l' , 'o' };
harness.check(!( !String.valueOf( data ).equals("hello")),
- "Error : test_valueOf failed - 3");
+ "test_valueOf - 3");
harness.check(!( !String.copyValueOf( data ).equals("hello")),
- "Error : test_valueOf failed - 3a");
+ "test_valueOf - 3a");
try {
String str = String.valueOf(data , -1 , 4 );
- harness.fail("Error : test_valueOf failed - 4");
+ harness.fail("test_valueOf - 4");
}catch ( IndexOutOfBoundsException e ){}
try {
String str = String.valueOf(data , 1 , 5 );
- harness.fail("Error : test_valueOf failed - 5");
+ harness.fail("test_valueOf - 5");
}catch ( IndexOutOfBoundsException e ){}
try {
String str = String.valueOf(data , 1 , -5 );
- harness.fail("Error : test_valueOf failed - 6");
+ harness.fail("test_valueOf - 6");
}catch ( IndexOutOfBoundsException e ){}
try {
String str = String.valueOf(null , 1 , 3 );
- harness.fail("Error : test_valueOf failed - 7");
+ harness.fail("test_valueOf - 7");
}catch ( NullPointerException e ){}
harness.check(!( !String.valueOf(data , 2 , 2 ).equals("ll")),
- "Error : test_valueOf failed - 8");
+ "test_valueOf - 8");
harness.check(!( !String.copyValueOf(data , 2 , 2 ).equals("ll")),
- "Error : test_valueOf failed - 8a");
+ "test_valueOf - 8a");
harness.check(!( !String.valueOf(true).equals("true")),
- "Error : test_valueOf failed - 9");
+ "test_valueOf - 9");
harness.check(!( !String.valueOf(false).equals("false")),
- "Error : test_valueOf failed - 10");
+ "test_valueOf - 10");
harness.check(!( !String.valueOf('c').equals("c")),
- "Error : test_valueOf failed - 11");
+ "test_valueOf - 11");
harness.check(!( !String.valueOf(' ').equals(" ")),
- "Error : test_valueOf failed - 12");
+ "test_valueOf - 12");
harness.check(!( !String.valueOf(234).equals("234")),
- "Error : test_valueOf failed - 13");
+ "test_valueOf - 13");
harness.check(!( !String.valueOf(234L).equals("234")),
- "Error : test_valueOf failed - 14");
+ "test_valueOf - 14");
harness.check(!( !String.valueOf(23.45f).equals("23.45")),
- "Error : test_valueOf failed - 15");
+ "test_valueOf - 15");
harness.check(!( !String.valueOf(23.4).equals("23.4")),
- "Error : test_valueOf failed - 16");
+ "test_valueOf - 16");
}
public void test_intern()
@@ -843,24 +843,24 @@
String hp = "hp";
String nullstr = "";
harness.check(!( "hp".intern() != hp.intern()),
- "Error : test_intern failed - 1");
+ "test_intern - 1");
harness.check(!( "pqr".intern() == hp.intern()),
- "Error : test_intern failed - 2");
+ "test_intern - 2");
harness.check(!( "".intern() != nullstr.intern()),
- "Error : test_intern failed - 3");
+ "test_intern - 3");
harness.check(!( "".intern() == hp.intern()),
- "Error : test_intern failed - 4");
+ "test_intern - 4");
hp = "";
harness.check(!( "".intern() != hp.intern()),
- "Error : test_intern failed - 5");
+ "test_intern - 5");
StringBuffer buff= new StringBuffer();
buff.append('a');
buff.append('b');
harness.check(!( "ab".intern() != buff.toString().intern()),
- "Error : test_intern failed - 6");
+ "test_intern - 6");
StringBuffer buff1 = new StringBuffer();
harness.check(!( "".intern() != buff1.toString().intern()),
- "Error : test_intern failed - 7");
+ "test_intern - 7");
}
public void test_trim()
Index: ./gnu/testlet/java/lang/StringBuffer/StringBufferTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/StringBuffer/StringBufferTest.java,v
retrieving revision 1.6
diff -u -u -r1.6 StringBufferTest.java
--- ./gnu/testlet/java/lang/StringBuffer/StringBufferTest.java 21 Feb 2005 15:52:49 -0000 1.6
+++ ./gnu/testlet/java/lang/StringBuffer/StringBufferTest.java 22 Jan 2006 21:14:50 -0000
@@ -32,20 +32,20 @@
{
try {
StringBuffer str0 = new StringBuffer(-10);
- harness.fail("Error : test_Basics failed - 0");
+ harness.fail("test_Basics - 0");
}catch ( NegativeArraySizeException e ){}
StringBuffer str1 = new StringBuffer();
harness.check(!( str1.length() != 0 || str1.capacity() != 16 ),
- "Error : test_Basics failed - 1");
+ "test_Basics - 1");
harness.check(!( !str1.toString().equals("")),
- "Error : test_Basics failed - 2");
+ "test_Basics - 2");
StringBuffer str2 = new StringBuffer( "testing" );
harness.check(!( str2.length() != 7 ),
- "Error : test_Basics failed - 3");
+ "test_Basics - 3");
harness.check(!( !str2.toString().equals("testing")),
- "Error : test_Basics failed - 4");
+ "test_Basics - 4");
try {
@@ -60,7 +60,7 @@
thaht reason, this test is commented out
here: it's not a failure.
- harness.fail("Error : test_Basics failed - 5");
+ harness.fail("test_Basics - 5");
*/
}
@@ -68,17 +68,17 @@
StringBuffer str4 = new StringBuffer("hi there");
harness.check(!( str4.length () != 8 || str4.capacity () != 24 ),
- "Error : test_Basics failed - 6");
+ "test_Basics - 6");
harness.check(!( !str4.toString().equals("hi there")),
- "Error : test_Basics failed - 7");
+ "test_Basics - 7");
StringBuffer strbuf = new StringBuffer(0);
harness.check(!( ! strbuf.append("hiii").toString().equals("hiii")),
- "Error : test_Basics failed - 8");
+ "test_Basics - 8");
strbuf = new StringBuffer(10);
harness.check(!( strbuf.capacity() != 10 ),
- "Error : test_Basics failed - 9");
+ "test_Basics - 9");
}
@@ -88,11 +88,11 @@
StringBuffer str1 = new StringBuffer("218943289");
harness.check(!( !str1.toString().equals("218943289")),
- "Error : test_toString failed - 1");
+ "test_toString - 1");
str1 = new StringBuffer();
harness.check(!( !str1.toString().equals("")),
- "Error : test_toString failed - 2");
+ "test_toString - 2");
}
public void test_length()
@@ -101,10 +101,10 @@
StringBuffer buf2 = new StringBuffer("pentium");
harness.check(!( buf1.length() != 0 ),
- "Error : test_length failed - 1");
+ "test_length - 1");
harness.check(!( buf2.length() != 7 ),
- "Error : test_length failed - 2");
+ "test_length - 2");
}
public void test_capacity()
@@ -113,18 +113,18 @@
StringBuffer buf2 = new StringBuffer("pentiumpentiumpentium");
harness.check(!( buf1.capacity() != 16 ),
- "Error : test_capacity failed - 1");
+ "test_capacity - 1");
int cap = buf2.capacity();
harness.check(!( cap != 37 ),
- "Error : test_capacity failed - 2");
+ "test_capacity - 2");
buf1.ensureCapacity( 17);
// CYGNUS: This is a test for JDK 1.2 conformance
harness.check(!( buf1.capacity() != 34 ),
- "Error : test_capacity failed - 3");
+ "test_capacity - 3");
}
public void test_setLength()
@@ -133,17 +133,17 @@
try {
strbuf.setLength( -10);
- harness.fail("Error : test_setLength failed - 1");
+ harness.fail("test_setLength - 1");
}
catch ( IndexOutOfBoundsException e ){}
strbuf.setLength( 4 );
harness.check(!(strbuf.length() != 4 ),
- "Error : test_setLength failed - 2");
+ "test_setLength - 2");
harness.check(!( strbuf.charAt(0 ) != 'b' || strbuf.charAt(1 ) != 'a' ||
strbuf.charAt(2 ) != '\u0000' || strbuf.charAt(3 ) != '\u0000' ),
- "Error : test_setLength failed - 3");
+ "test_setLength - 3");
}
public void test_charAt()
@@ -153,17 +153,17 @@
(new StringBuffer("abcd")).charAt(2) != 'c' ||
(new StringBuffer("abcd")).charAt(3) != 'd' ),
- "Error : test_charAt failed - 1");
+ "test_charAt - 1");
try {
char ch = (new StringBuffer("abcd")).charAt(4);
- harness.fail("Error : test_charAt failed - 2");
+ harness.fail("test_charAt - 2");
}
catch ( IndexOutOfBoundsException e ){}
try {
char ch = (new StringBuffer("abcd")).charAt(-1);
- harness.fail("Error : test_charAt failed - 3");
+ harness.fail("test_charAt - 3");
}
catch ( IndexOutOfBoundsException e ){}
}
@@ -174,53 +174,53 @@
try {
str.getChars(0 , 3 , null , 1 );
- harness.fail("Error : test_getChars failed - 1");
+ harness.fail("test_getChars - 1");
}catch ( NullPointerException e ){}
char dst[] = new char[5];
try {
str.getChars(-1 , 3 , dst , 1 );
- harness.fail("Error : test_getChars failed - 2");
+ harness.fail("test_getChars - 2");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(4 , 3 , dst , 3 );
// CYGNUS: This is a test for JDK 1.2 conformance
- harness.fail("Error : test_getChars failed - 3");
+ harness.fail("test_getChars - 3");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 15 , dst , 1 );
- harness.fail("Error : test_getChars failed - 4");
+ harness.fail("test_getChars - 4");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 5 , dst , -1 );
- harness.fail("Error : test_getChars failed - 5");
+ harness.fail("test_getChars - 5");
}catch ( IndexOutOfBoundsException e ){}
try {
str.getChars(1 , 10 , dst , 1 );
- harness.fail("Error : test_getChars failed - 6");
+ harness.fail("test_getChars - 6");
}catch ( IndexOutOfBoundsException e ){}
str.getChars(0,5,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != 'b' || dst[2] != 'c' ||
dst[3] != 'd' || dst[4] != 'e' ),
- "Error : test_getChars failed - 7");
+ "test_getChars - 7");
dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = ' ';
str.getChars(0,0,dst, 0 );
harness.check(!( dst[0] != ' ' || dst[1] != ' ' || dst[2] != ' ' ||
dst[3] != ' ' || dst[4] != ' ' ),
- "Error : test_getChars failed - 9");
+ "test_getChars - 9");
dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = ' ';
str.getChars(0,1,dst, 0 );
harness.check(!( dst[0] != 'a' || dst[1] != ' ' || dst[2] != ' ' ||
dst[3] != ' ' || dst[4] != ' ' ),
- "Error : test_getChars failed - 10");
+ "test_getChars - 10");
dst = new char[25];
str.getChars(3,14,dst,12);
@@ -233,53 +233,53 @@
StringBuffer str = new StringBuffer();
Object nullobj = null;
harness.check(!( !str.append( nullobj ).toString().equals("null")),
- "Error : test_append failed - 1");
+ "test_append - 1");
harness.check(!( !str.append( new Integer(100) ).toString().equals("null100")),
- "Error : test_append failed - 2");
+ "test_append - 2");
StringBuffer str1 = new StringBuffer("hi");
str1 = str1.append( " there" );
str1 = str1.append( " buddy");
harness.check(!( !str1.toString().equals("hi there buddy")),
- "Error : test_append failed - 2");
+ "test_append - 2");
StringBuffer str2 = new StringBuffer();
str2 = str2.append("sdljfksdjfklsdjflksdjflkjsdlkfjlsdkjflksdjfklsd");
harness.check(!( !str2.toString().equals(
"sdljfksdjfklsdjflksdjflkjsdlkfjlsdkjflksdjfklsd")),
- "Error : test_append failed - 3");
+ "test_append - 3");
char carr[] = null;
StringBuffer str3 = new StringBuffer();
try {
str3 = str3.append( carr );
- harness.fail("Error : test_append failed - 4");
+ harness.fail("test_append - 4");
}
catch ( NullPointerException e ){}
char carr1[] = {'h','i','t','h','e','r'};
StringBuffer str4 = new StringBuffer("!");
harness.check(!( !str4.append( carr1 ).toString().equals("!hither")),
- "Error : test_append failed - 5");
+ "test_append - 5");
try {
str3 = str3.append( carr , 0 , 3);
- harness.fail("Error : test_append failed - 6");
+ harness.fail("test_append - 6");
}
catch ( NullPointerException e ){}
str3 = new StringBuffer();
try {
str3 = str3.append( carr1 , -1 , 3);
- harness.fail("Error : test_append failed - 6");
+ harness.fail("test_append - 6");
}
catch ( IndexOutOfBoundsException e ){}
try {
str3 = str3.append ( carr1 , 0 , -3);
- harness.fail("Error : test_append failed - 6");
+ harness.fail("test_append - 6");
}
catch ( IndexOutOfBoundsException e ){}
@@ -287,35 +287,35 @@
StringBuffer str5 = new StringBuffer("!");
str5 = str5.append(carr1 , 2 , 3 );
harness.check(!( !str5.toString().equals("!the")),
- "Error : test_append failed - 7");
+ "test_append - 7");
str5 = new StringBuffer();
str5 = str5.append( true );
harness.check(!( !str5.toString().equals("true")),
- "Error : test_append failed - 8");
+ "test_append - 8");
str5 = str5.append( false );
harness.check(!( !str5.toString().equals("truefalse")),
- "Error : test_append failed - 9");
+ "test_append - 9");
str5 = str5.append( 20);
harness.check(!( !str5.toString().equals("truefalse20")),
- "Error : test_append failed - 10");
+ "test_append - 10");
str5 = new StringBuffer();
str5 = str5.append( 2034L );
harness.check(!( !str5.toString().equals("2034")),
- "Error : test_append failed - 11");
+ "test_append - 11");
str5 = new StringBuffer();
str5 = str5.append( 34.45f );
harness.check(!( !str5.toString().equals("34.45")),
- "Error : test_append failed - 12");
+ "test_append - 12");
str5 = new StringBuffer();
str5 = str5.append( 34.46 );
harness.check(!( !str5.toString().equals("34.46")),
- "Error : test_append failed - 13");
+ "test_append - 13");
}
public void test_insert()
@@ -324,92 +324,92 @@
Object obj = null;
buf = buf.insert(5 , obj);
harness.check(!( !buf.toString().equals("12345null67")),
- "Error : test_insert failed - 1");
+ "test_insert - 1");
try {
buf = buf.insert(-1 , new Object());
- harness.fail("Error : test_insert failed - 2");
+ harness.fail("test_insert - 2");
}catch ( IndexOutOfBoundsException e ){}
buf = new StringBuffer("1234567");
try {
buf = buf.insert(8 , new Object() );
- harness.fail("Error : test_insert failed - 3");
+ harness.fail("test_insert - 3");
}catch ( IndexOutOfBoundsException e ){}
buf = new StringBuffer("1234567");
buf = buf.insert(4 , "inserted" );
harness.check(!( !buf.toString().equals("1234inserted567")),
- "Error : test_insert failed - 4");
+ "test_insert - 4");
buf = new StringBuffer("1234567");
char cdata[] = null;
try {
buf = buf.insert(4 , cdata );
- harness.fail("Error : test_insert failed - 5");
+ harness.fail("test_insert - 5");
}catch ( NullPointerException e ) {}
cdata = new char[2];
try {
buf = buf.insert(-1 , cdata );
- harness.fail("Error : test_insert failed - 6");
+ harness.fail("test_insert - 6");
}catch ( IndexOutOfBoundsException e ){}
try {
buf = buf.insert(8 , cdata );
- harness.fail("Error : test_insert failed - 7");
+ harness.fail("test_insert - 7");
}catch ( IndexOutOfBoundsException e ){}
buf = new StringBuffer("1234567");
char cdata1[] = {'h','e','l','l','o'};
buf = buf.insert(4 , cdata1 );
harness.check(!( !buf.toString().equals("1234hello567")),
- "Error : test_insert failed - 8");
+ "test_insert - 8");
buf = new StringBuffer("1234567");
buf = buf.insert(0 , true );
harness.check(!( !buf.toString().equals("true1234567")),
- "Error : test_insert failed - 9");
+ "test_insert - 9");
buf = new StringBuffer("1234567");
buf = buf.insert(7 , false );
harness.check(!( !buf.toString().equals("1234567false")),
- "Error : test_insert failed - 10");
+ "test_insert - 10");
buf = new StringBuffer("1234567");
buf = buf.insert(0 , 'c' );
harness.check(!( !buf.toString().equals("c1234567")),
- "Error : test_insert failed - 11");
+ "test_insert - 11");
buf = new StringBuffer("1234567");
buf = buf.insert(7 , 'b' );
harness.check(!( !buf.toString().equals("1234567b")),
- "Error : test_insert failed - 12");
+ "test_insert - 12");
buf = new StringBuffer("1234567");
buf = buf.insert(7 , 999 );
harness.check(!( !buf.toString().equals("1234567999")),
- "Error : test_insert failed - 13");
+ "test_insert - 13");
buf = new StringBuffer("1234567");
buf = buf.insert(0, 99.9f );
harness.check(!( !buf.toString().equals("99.91234567")),
- "Error : test_insert failed - 14");
+ "test_insert - 14");
buf = new StringBuffer("1234567");
buf = buf.insert(3, 34.46 );
harness.check(!( !buf.toString().equals("12334.464567")),
- "Error : test_insert failed - 15 "
+ "test_insert - 15 "
+ buf.toString());
buf = new StringBuffer("1234567");
buf = buf.insert(3, (long)1230 );
harness.check(!( !buf.toString().equals("12312304567")),
- "Error : test_insert failed - 16 "
+ "test_insert - 16 "
+ buf.toString());
}
@@ -418,23 +418,23 @@
{
StringBuffer buff = new StringBuffer();
harness.check(!( !buff.reverse().toString().equals("")),
- "Error : test_reverse failed - 1");
+ "test_reverse - 1");
buff = new StringBuffer("babu");
harness.check(!( !buff.reverse().toString().equals("ubab")),
- "Error : test_reverse failed - 2");
+ "test_reverse - 2");
buff = new StringBuffer("malayalam");
harness.check(!( !buff.reverse().toString().equals("malayalam")),
- "Error : test_reverse failed - 3");
+ "test_reverse - 3");
buff = new StringBuffer("cnbcbnc");
harness.check(!( !buff.reverse().toString().equals("cnbcbnc")),
- "Error : test_reverse failed - 4");
+ "test_reverse - 4");
buff = new StringBuffer("vinod");
harness.check(!( !buff.reverse().toString().equals("doniv")),
- "Error : test_reverse failed - 5");
+ "test_reverse - 5");
}
public void testall()