MemoryTest LP64 fixes.
Change-Id: I767b1366d2315522b51f60667eb5c04b3e8dff39
Signed-off-by: Stuart Monteith <Stuart.Monteith@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
diff --git a/luni/src/test/java/libcore/io/MemoryTest.java b/luni/src/test/java/libcore/io/MemoryTest.java
index 9a596fb..c817b20 100644
--- a/luni/src/test/java/libcore/io/MemoryTest.java
+++ b/luni/src/test/java/libcore/io/MemoryTest.java
@@ -32,10 +32,10 @@
int scale = SizeOf.INT;
VMRuntime runtime = VMRuntime.getRuntime();
byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
- int base_ptr = (int) runtime.addressOf(array);
+ long base_ptr = runtime.addressOf(array);
for (int ptr_offset = 0; ptr_offset < 2; ++ptr_offset) {
- int ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
+ long ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
Arrays.fill(array, (byte) 0);
// Regular copy.
@@ -57,7 +57,7 @@
}
}
- private void assertIntsEqual(int[] expectedValues, int ptr, boolean swap) {
+ private void assertIntsEqual(int[] expectedValues, long ptr, boolean swap) {
for (int i = 0; i < expectedValues.length; ++i) {
assertEquals(expectedValues[i], Memory.peekInt(ptr + SizeOf.INT * i, swap));
}
@@ -73,10 +73,10 @@
int scale = SizeOf.LONG;
VMRuntime runtime = VMRuntime.getRuntime();
byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
- int base_ptr = (int) runtime.addressOf(array);
+ long base_ptr = runtime.addressOf(array);
for (int ptr_offset = 0; ptr_offset < 2; ++ptr_offset) {
- int ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
+ long ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
Arrays.fill(array, (byte) 0);
// Regular copy.
@@ -98,7 +98,7 @@
}
}
- private void assertLongsEqual(long[] expectedValues, int ptr, boolean swap) {
+ private void assertLongsEqual(long[] expectedValues, long ptr, boolean swap) {
for (int i = 0; i < expectedValues.length; ++i) {
assertEquals(expectedValues[i], Memory.peekLong(ptr + SizeOf.LONG * i, swap));
}
@@ -111,10 +111,10 @@
int scale = SizeOf.SHORT;
VMRuntime runtime = VMRuntime.getRuntime();
byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
- int base_ptr = (int) runtime.addressOf(array);
+ long base_ptr = runtime.addressOf(array);
for (int ptr_offset = 0; ptr_offset < 2; ++ptr_offset) {
- int ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
+ long ptr = base_ptr + ptr_offset; // To test aligned and unaligned accesses.
Arrays.fill(array, (byte) 0);
// Regular copy.
@@ -136,7 +136,7 @@
}
}
- private void assertShortsEqual(short[] expectedValues, int ptr, boolean swap) {
+ private void assertShortsEqual(short[] expectedValues, long ptr, boolean swap) {
for (int i = 0; i < expectedValues.length; ++i) {
assertEquals(expectedValues[i], Memory.peekShort(ptr + SizeOf.SHORT * i, swap));
}