summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-03-12 14:11:40 -0700
committerAndreas Gampe <agampe@google.com>2014-03-12 14:20:31 -0700
commitcfa5c4805b9e756aaa142047306bad2b13107834 (patch)
tree067839e9acc27de8c6c4abf7e5447ec943a50250 /runtime
parent63dcdff34c40a64df6939ea5bba71813abd2acd3 (diff)
downloadart-cfa5c4805b9e756aaa142047306bad2b13107834.zip
art-cfa5c4805b9e756aaa142047306bad2b13107834.tar.gz
art-cfa5c4805b9e756aaa142047306bad2b13107834.tar.bz2
Fix tests for 64b
These tests make assumptions about pointer sizes. Change-Id: Idfd410144393d716ae176a6e9a51c5b414e0888e
Diffstat (limited to 'runtime')
-rw-r--r--runtime/base/hex_dump_test.cc11
-rw-r--r--runtime/exception_test.cc6
2 files changed, 13 insertions, 4 deletions
diff --git a/runtime/base/hex_dump_test.cc b/runtime/base/hex_dump_test.cc
index d950961..3d782b2 100644
--- a/runtime/base/hex_dump_test.cc
+++ b/runtime/base/hex_dump_test.cc
@@ -24,11 +24,18 @@
namespace art {
+#if defined(__LP64__)
+#define ZEROPREFIX "00000000"
+#else
+#define ZEROPREFIX
+#endif
+
TEST(HexDump, OneLine) {
const char* test_text = "0123456789abcdef";
std::ostringstream oss;
oss << HexDump(test_text, strlen(test_text), false, "");
EXPECT_STREQ(oss.str().c_str(),
+ ZEROPREFIX
"00000000: 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 0123456789abcdef");
}
@@ -37,7 +44,9 @@ TEST(HexDump, MultiLine) {
std::ostringstream oss;
oss << HexDump(test_text, strlen(test_text), false, "");
EXPECT_STREQ(oss.str().c_str(),
+ ZEROPREFIX
"00000000: 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 0123456789abcdef\n"
+ ZEROPREFIX
"00000010: 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 0123456789ABCDEF");
}
@@ -56,7 +65,7 @@ TEST(HexDump, Prefix) {
std::ostringstream oss;
oss << HexDump(test_text, strlen(test_text), false, "test prefix: ");
EXPECT_STREQ(oss.str().c_str(),
- "test prefix: 00000000: 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 "
+ "test prefix: " ZEROPREFIX "00000000: 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 "
"0123456789abcdef");
}
diff --git a/runtime/exception_test.cc b/runtime/exception_test.cc
index 5e3f504..4a75152 100644
--- a/runtime/exception_test.cc
+++ b/runtime/exception_test.cc
@@ -76,7 +76,7 @@ class ExceptionTest : public CommonRuntimeTest {
method_f_ = my_klass_->FindVirtualMethod("f", "()I");
ASSERT_TRUE(method_f_ != NULL);
- method_f_->SetFrameSizeInBytes(kStackAlignment);
+ method_f_->SetFrameSizeInBytes(4 * kPointerSize);
method_f_->SetEntryPointFromQuickCompiledCode(&fake_code_[sizeof(code_size)]);
method_f_->SetMappingTable(&fake_mapping_data_.GetData()[0]);
method_f_->SetVmapTable(&fake_vmap_table_data_.GetData()[0]);
@@ -84,7 +84,7 @@ class ExceptionTest : public CommonRuntimeTest {
method_g_ = my_klass_->FindVirtualMethod("g", "(I)V");
ASSERT_TRUE(method_g_ != NULL);
- method_g_->SetFrameSizeInBytes(kStackAlignment);
+ method_g_->SetFrameSizeInBytes(4 * kPointerSize);
method_g_->SetEntryPointFromQuickCompiledCode(&fake_code_[sizeof(code_size)]);
method_g_->SetMappingTable(&fake_mapping_data_.GetData()[0]);
method_g_->SetVmapTable(&fake_vmap_table_data_.GetData()[0]);
@@ -151,7 +151,7 @@ TEST_F(ExceptionTest, StackTraceElement) {
std::vector<uintptr_t> fake_stack;
ASSERT_EQ(kStackAlignment, 16U);
- ASSERT_EQ(sizeof(uintptr_t), sizeof(uint32_t));
+ // ASSERT_EQ(sizeof(uintptr_t), sizeof(uint32_t));
if (!kUsePortableCompiler) {
// Create two fake stack frames with mapping data created in SetUp. We map offset 3 in the code