Add some missing JNI string functions, GetObjectArrayElement, and all the primitive array region functions.
This also pulls the UTF-8/UTF-16 functions out of class String.
Change-Id: I75936b84fd619c9cf91f6e6a6037488220b05781
diff --git a/src/object_test.cc b/src/object_test.cc
index aa3cf86..fc58778 100644
--- a/src/object_test.cc
+++ b/src/object_test.cc
@@ -15,12 +15,12 @@
class ObjectTest : public CommonTest {
protected:
- void AssertString(size_t length,
+ void AssertString(int32_t length,
const char* utf8_in,
const char* utf16_expected_le,
uint32_t hash_expected) {
uint16_t utf16_expected[length];
- for (size_t i = 0; i < length; i++) {
+ for (int32_t i = 0; i < length; i++) {
uint16_t ch = (((utf16_expected_le[i*2 + 0] & 0xff) << 8) |
((utf16_expected_le[i*2 + 1] & 0xff) << 0));
utf16_expected[i] = ch;
@@ -31,8 +31,8 @@
ASSERT_TRUE(string->GetCharArray() != NULL);
ASSERT_TRUE(string->GetCharArray()->GetData() != NULL);
// strlen is necessary because the 1-character string "\0" is interpreted as ""
- ASSERT_TRUE(string->Equals(utf8_in) || length != strlen(utf8_in));
- for (size_t i = 0; i < length; i++) {
+ ASSERT_TRUE(string->Equals(utf8_in) || length != static_cast<int32_t>(strlen(utf8_in)));
+ for (int32_t i = 0; i < length; i++) {
EXPECT_EQ(utf16_expected[i], string->CharAt(i));
}
EXPECT_EQ(hash_expected, string->GetHashCode());