From e20dcd910d0b6382ff742c1da2c7a6198bd965ae Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 28 Sep 2011 14:46:11 +0000 Subject: [PATCH] ICU-8268 toString on array doesn't produce anything useful. Use Arrays.toString. X-SVN-Rev: 30730 --- .../com/ibm/icu/dev/test/lang/UCharacterTest.java | 12 ++++++------ .../com/ibm/icu/dev/test/util/VersionInfoTest.java | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java index 473f854c6bf..3f3a8cdcdd6 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java @@ -2996,7 +2996,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointAt(reg_text, 100, limitCases[i]); errln("UCharacter.codePointAt was suppose to return an exception " + "but got " + UCharacter.codePointAt(reg_text, 100, limitCases[i]) + - ". The following passed parameters were Text: " + reg_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(reg_text) + ", Start: " + 100 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } @@ -3008,7 +3008,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointAt(empty_text, 0, limitCases[i]); errln("UCharacter.codePointAt was suppose to return an exception " + "but got " + UCharacter.codePointAt(empty_text, 0, limitCases[i]) + - ". The following passed parameters were Text: " + empty_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(empty_text) + ", Start: " + 0 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } @@ -3017,7 +3017,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointCount(one_char_text, 0, limitCases[i]); errln("UCharacter.codePointCount was suppose to return an exception " + "but got " + UCharacter.codePointCount(one_char_text, 0, limitCases[i]) + - ". The following passed parameters were Text: " + one_char_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(one_char_text) + ", Start: " + 0 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } @@ -3181,7 +3181,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointCount(reg_text, 100, limitCases[i]); errln("UCharacter.codePointCount was suppose to return an exception " + "but got " + UCharacter.codePointCount(reg_text, 100, limitCases[i]) + - ". The following passed parameters were Text: " + reg_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(reg_text) + ", Start: " + 100 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } @@ -3193,7 +3193,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointCount(empty_text, 0, limitCases[i]); errln("UCharacter.codePointCount was suppose to return an exception " + "but got " + UCharacter.codePointCount(empty_text, 0, limitCases[i]) + - ". The following passed parameters were Text: " + empty_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(empty_text) + ", Start: " + 0 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } @@ -3202,7 +3202,7 @@ public final class UCharacterTest extends TestFmwk UCharacter.codePointCount(one_char_text, 0, limitCases[i]); errln("UCharacter.codePointCount was suppose to return an exception " + "but got " + UCharacter.codePointCount(one_char_text, 0, limitCases[i]) + - ". The following passed parameters were Text: " + one_char_text.toString() + ", Start: " + + ". The following passed parameters were Text: " + Arrays.toString(one_char_text) + ", Start: " + 0 + ", Limit: " + limitCases[i] + "."); } catch(Exception e){ } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/VersionInfoTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/VersionInfoTest.java index 4bd8a51d9f0..5811a31c988 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/VersionInfoTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/VersionInfoTest.java @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1996-2010, International Business Machines Corporation and * +* Copyright (C) 1996-2011, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* */ @@ -9,6 +9,8 @@ package com.ibm.icu.dev.test.util; +import java.util.Arrays; + import com.ibm.icu.dev.test.TestFmwk; import com.ibm.icu.util.VersionInfo; @@ -119,8 +121,8 @@ public final class VersionInfoTest extends TestFmwk VersionInfo v1 = getInstance(COMPARE_EQUAL_INT_[i]); VersionInfo v2 = getInstance(COMPARE_EQUAL_INT_[i + 1]); if (v1.compareTo(v2) != 0) { - errln(COMPARE_EQUAL_INT_[i] + " should equal " + - COMPARE_EQUAL_INT_[i + 1]); + errln(Arrays.toString(COMPARE_EQUAL_INT_[i]) + " should equal " + + Arrays.toString(COMPARE_EQUAL_INT_[i + 1])); } } for (int i = 0; i < COMPARE_LESS_.length - 1; i ++) { @@ -181,7 +183,7 @@ public final class VersionInfoTest extends TestFmwk } v = getInstance(TOSTRING_INT_[i]); if (!v.toString().equals(TOSTRING_RESULT_[i])) { - errln("toString() for " + TOSTRING_INT_[i] + + errln("toString() for " + Arrays.toString(TOSTRING_INT_[i]) + " should produce " + TOSTRING_RESULT_[i]); } } -- 2.40.0