summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/object_test.cc
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2014-01-15 13:49:50 -0800
committerJeff Hao <jeffhao@google.com>2015-04-27 18:54:52 -0700
commit848f70a3d73833fc1bf3032a9ff6812e429661d9 (patch)
treeb0349b3a40aab5a915af491b100659a5ca9fbbf6 /runtime/mirror/object_test.cc
parentd14438f0c5071962be7fab572b54687d32d9d087 (diff)
downloadart-848f70a3d73833fc1bf3032a9ff6812e429661d9.zip
art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.gz
art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.bz2
Replace String CharArray with internal uint16_t array.
Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
Diffstat (limited to 'runtime/mirror/object_test.cc')
-rw-r--r--runtime/mirror/object_test.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index 2262af5..8e50a7a 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -61,14 +61,13 @@ class ObjectTest : public CommonRuntimeTest {
Handle<String> string(
hs.NewHandle(String::AllocFromModifiedUtf8(self, expected_utf16_length, utf8_in)));
ASSERT_EQ(expected_utf16_length, string->GetLength());
- ASSERT_TRUE(string->GetCharArray() != nullptr);
- ASSERT_TRUE(string->GetCharArray()->GetData() != nullptr);
+ ASSERT_TRUE(string->GetValue() != nullptr);
// strlen is necessary because the 1-character string "\x00\x00" is interpreted as ""
ASSERT_TRUE(string->Equals(utf8_in) || (expected_utf16_length == 1 && strlen(utf8_in) == 0));
ASSERT_TRUE(string->Equals(StringPiece(utf8_in)) ||
(expected_utf16_length == 1 && strlen(utf8_in) == 0));
for (int32_t i = 0; i < expected_utf16_length; i++) {
- EXPECT_EQ(utf16_expected[i], string->UncheckedCharAt(i));
+ EXPECT_EQ(utf16_expected[i], string->CharAt(i));
}
EXPECT_EQ(expected_hash, string->GetHashCode());
}
@@ -491,12 +490,6 @@ TEST_F(ObjectTest, StringLength) {
Handle<String> string(hs.NewHandle(String::AllocFromModifiedUtf8(soa.Self(), "android")));
EXPECT_EQ(string->GetLength(), 7);
EXPECT_EQ(string->GetUtfLength(), 7);
-
- string->SetOffset(2);
- string->SetCount(5);
- EXPECT_TRUE(string->Equals("droid"));
- EXPECT_EQ(string->GetLength(), 5);
- EXPECT_EQ(string->GetUtfLength(), 5);
}
TEST_F(ObjectTest, DescriptorCompare) {