Commit 476f42f7 authored by Elliott Hughes's avatar Elliott Hughes Committed by Android (Google) Code Review
Browse files

Merge "Various broken tests." into dalvik-dev

parents 4befccf6 a9d779fa
......@@ -634,10 +634,6 @@ test org.apache.harmony.nio.tests.java.nio.channels.DatagramChannelTest#testRead
result EXEC_FAILED
pattern .*java.lang.IllegalArgumentException: read-only buffer.*
# we don't cache canonical paths.
test org.apache.harmony.luni.tests.java.io.FileCanonPathCacheTest
result EXEC_FAILED
# ICU doesn't provide localized pattern characters, and these tests assume the locale they're using has them.
test org.apache.harmony.text.tests.java.text.SimpleDateFormatTest#test_applyLocalizedPatternLjava_lang_String
result EXEC_FAILED
......@@ -685,3 +681,26 @@ result UNSUPPORTED
test java.util.ArrayList.IteratorMicroBenchmark
result UNSUPPORTED
# This test is obsoleted by our java.lang.CharacterTest#test_valueOfC.
test org.apache.harmony.luni.tests.java.lang.CharacterImplTest#test_valueOfC
result EXEC_FAILED
# The RI is still on Unicode 4.0, we're on 5.2, and Harmony is inconsistent
# between its test for isJavaIdentifierPart(char) and isJavaIdentifierPart(int).
test org.apache.harmony.luni.tests.java.lang.CharacterTest.test_isJavaIdentifierPartC
result EXEC_FAILED
# We removed this: we don't support Pack200.
test org.apache.harmony.archive.tests.java.util.jar.Pack200Test
result UNSUPPORTED
# We removed this: we don't cache canonical paths.
test org.apache.harmony.luni.tests.java.io.FileCanonPathCacheTest
result UNSUPPORTED
# We removed this: we don't throw NotYetImplementedException.
test org.apache.harmony.luni.tests.util.NYITest
result UNSUPPORTED
......@@ -49,8 +49,10 @@ public final class UCharacter {
/**
* The indices of the entries of this table correspond with the value
* of the ICU enum UBlockCode. When updating ICU it's necessary
* to check if there where any changes for the properties
* used by java.lang.Character.
* to check if there were any changes for the properties
* used by java.lang.Character; realistically, ICU will offer new code
* blocks long before there's any corresponding public Java API.
*
* The enum is defined in common/unicode/uchar.h
*/
UnicodeBlock[] result = new UnicodeBlock[] { null,
......
......@@ -17,27 +17,19 @@
package java.lang;
import java.io.Serializable;
// BEGIN android-removed
// import java.util.SortedMap;
// import java.util.TreeMap;
//
// import org.apache.harmony.luni.util.BinarySearch;
// END android-removed
// BEGIN android-changed
import com.ibm.icu4jni.lang.UCharacter;
// END android-changed
import java.io.Serializable;
/**
* The wrapper for the primitive type {@code char}. This class also provides a
* number of utility methods for working with characters.
* <p>
* Character data is based upon the Unicode Standard, 4.0. The Unicode
*
* <p>Character data is kept up to date as Unicode evolves.
* This implementation is currently based on Unicode 5.2. The Unicode
* specification, character tables and other information are available at <a
* href="http://www.unicode.org/">http://www.unicode.org/</a>.
* <p>
* Unicode characters are referred to as <i>code points</i>. The range of valid
*
* <p>Unicode characters are referred to as <i>code points</i>. The range of valid
* code points is U+0000 to U+10FFFF. The <i>Basic Multilingual Plane (BMP)</i>
* is the code point range U+0000 to U+FFFF. Characters above the BMP are
* referred to as <i>Supplementary Characters</i>. On the Java platform, UTF-16
......
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package java.lang;
public class CharacterTest extends junit.framework.TestCase {
public void test_valueOfC() {
// The JLS requires caching for chars between "\u0000 to \u007f":
// http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7
// Harmony caches 0-512 and tests for this behavior, so we suppress that test and use this.
for (char c = '\u0000'; c <= '\u007f'; ++c) {
Character e = new Character(c);
Character a = Character.valueOf(c);
assertEquals(e, a);
assertSame(Character.valueOf(c), Character.valueOf(c));
}
for (int c = '\u0080'; c <= Character.MAX_VALUE; ++c) {
assertEquals(new Character((char) c), Character.valueOf((char) c));
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment