image_test should include at least one DexFile

Change-Id: Ica6d6fa39f10f5efda549fbb7ef08bc00404e4de
diff --git a/src/image_test.cc b/src/image_test.cc
index 57afe68..f5f96d8 100644
--- a/src/image_test.cc
+++ b/src/image_test.cc
@@ -19,6 +19,7 @@
 TEST_F(ImageTest, WriteRead) {
   ScratchFile tmp_oat;
   std::vector<const DexFile*> dex_files;
+  dex_files.push_back(GetLibCoreDex());
   bool success_oat = OatWriter::Create(tmp_oat.GetFile(), NULL, dex_files, *compiler_.get());
   ASSERT_TRUE(success_oat);
 
diff --git a/src/oat_file.cc b/src/oat_file.cc
index cfc8326..7cc42ab 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -85,7 +85,7 @@
   const byte* oat = map->GetAddress();
 
   oat += sizeof(OatHeader);
-  CHECK_LT(oat, map->GetLimit()) << filename;
+  CHECK_LE(oat, map->GetLimit()) << filename;
   for (size_t i = 0; i < oat_header.GetDexFileCount(); i++) {
     size_t dex_file_location_size = *reinterpret_cast<const uint32_t*>(oat);
     CHECK_GT(dex_file_location_size, 0U) << filename;
@@ -115,7 +115,7 @@
     const uint32_t* methods_offsets_pointer = reinterpret_cast<const uint32_t*>(oat);
 
     oat += (sizeof(*methods_offsets_pointer) * header->class_defs_size_);
-    CHECK_LT(oat, map->GetLimit()) << filename;
+    CHECK_LE(oat, map->GetLimit()) << filename;
 
     oat_dex_files_[dex_file_location] = new OatDexFile(this,
                                                        dex_file_location,