diff options
| author | 2015-06-01 16:33:53 -0700 | |
|---|---|---|
| committer | 2015-06-01 16:36:14 -0700 | |
| commit | 68c868ea785c39e6e20a97cc829cce26adec4281 (patch) | |
| tree | 432204a5e9855b3b0692b7cc655c442cbd1d816a | |
| parent | 816de3a319c80b966e34928c38f1f904657711fb (diff) | |
Fix bogus image test assert
Previously we were comparing the size of the non moving space to
size of the image file.
Now we properly compare the size of the image space against the size
of the image file.
Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a
| -rw-r--r-- | compiler/image_test.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/image_test.cc b/compiler/image_test.cc index dbdd3504d3..772cc80146 100644 --- a/compiler/image_test.cc +++ b/compiler/image_test.cc @@ -105,6 +105,7 @@ TEST_F(ImageTest, WriteRead) { << oat_file.GetFilename(); } + uint64_t image_file_size; { std::unique_ptr<File> file(OS::OpenFileForReading(image_file.GetFilename().c_str())); ASSERT_TRUE(file.get() != nullptr); @@ -121,7 +122,8 @@ TEST_F(ImageTest, WriteRead) { ASSERT_FALSE(space->IsImageSpace()); ASSERT_TRUE(space != nullptr); ASSERT_TRUE(space->IsMallocSpace()); - ASSERT_LE(space->Size(), static_cast<size_t>(file->GetLength())); + + image_file_size = file->GetLength(); } ASSERT_TRUE(compiler_driver_->GetImageClasses() != nullptr); @@ -167,6 +169,9 @@ TEST_F(ImageTest, WriteRead) { ASSERT_TRUE(heap->GetNonMovingSpace()->IsMallocSpace()); gc::space::ImageSpace* image_space = heap->GetImageSpace(); + ASSERT_TRUE(image_space != nullptr); + ASSERT_LE(image_space->Size(), image_file_size); + image_space->VerifyImageAllocations(); uint8_t* image_begin = image_space->Begin(); uint8_t* image_end = image_space->End(); |