summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Richard Uhler <ruhler@google.com> 2015-05-11 17:46:06 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-05-11 17:46:07 +0000
commitc55efc7335e35f6731b04afc3a1db838c086beb3 (patch)
tree6800f29cef547f5c55324b7ebe882976b17a57bc
parent9dfba7202b3777a14792759f097fe4da37264988 (diff)
parentf16d5727f9062379519043bc063a2c0527c59eb8 (diff)
Merge "Add more diagnostics info to flaky oat file assistant test."
-rw-r--r--runtime/oat_file_assistant_test.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc
index 3f6b2d2cc6..865fcb063a 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat_file_assistant_test.cc
@@ -29,6 +29,7 @@
#include "class_linker-inl.h"
#include "common_runtime_test.h"
#include "compiler_callbacks.h"
+#include "gc/space/image_space.h"
#include "mem_map.h"
#include "os.h"
#include "scoped_thread_state_change.h"
@@ -610,10 +611,23 @@ TEST_F(OatFileAssistantTest, OdexOatOverlap) {
// Things aren't relocated, so it should fall back to interpreted.
std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile();
ASSERT_TRUE(oat_file.get() != nullptr);
+
EXPECT_FALSE(oat_file->IsExecutable());
std::vector<std::unique_ptr<const DexFile>> dex_files;
dex_files = oat_file_assistant.LoadDexFiles(*oat_file, dex_location.c_str());
EXPECT_EQ(1u, dex_files.size());
+
+ // Add some extra checks to help diagnose apparently flaky test failures.
+ Runtime* runtime = Runtime::Current();
+ const gc::space::ImageSpace* image_space = runtime->GetHeap()->GetImageSpace();
+ ASSERT_TRUE(image_space != nullptr);
+ const ImageHeader& image_header = image_space->GetImageHeader();
+ const OatHeader& oat_header = oat_file->GetOatHeader();
+ EXPECT_FALSE(oat_file->IsPic());
+ EXPECT_EQ(image_header.GetOatChecksum(), oat_header.GetImageFileLocationOatChecksum());
+ EXPECT_NE(reinterpret_cast<uintptr_t>(image_header.GetOatDataBegin()),
+ oat_header.GetImageFileLocationOatDataBegin());
+ EXPECT_NE(image_header.GetPatchDelta(), oat_header.GetImagePatchDelta());
}
// Case: We have a DEX file and a PIC ODEX file, but no OAT file.