summaryrefslogtreecommitdiff
path: root/runtime/oat_file_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/oat_file_test.cc')
-rw-r--r--runtime/oat_file_test.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/runtime/oat_file_test.cc b/runtime/oat_file_test.cc
index a88553ca7b..3bd6df2ef5 100644
--- a/runtime/oat_file_test.cc
+++ b/runtime/oat_file_test.cc
@@ -20,6 +20,7 @@
#include <gtest/gtest.h>
+#include "base/out.h"
#include "common_runtime_test.h"
#include "scoped_thread_state_change.h"
@@ -75,16 +76,16 @@ TEST_F(OatFileTest, DexFileDependencies) {
std::string error_msg;
// No dependencies.
- EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(nullptr, &error_msg)) << error_msg;
- EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies("", &error_msg)) << error_msg;
+ EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(nullptr, outof(error_msg))) << error_msg;
+ EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies("", outof(error_msg))) << error_msg;
// Ill-formed dependencies.
- EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc", &error_msg));
- EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*123*def", &error_msg));
- EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*def*", &error_msg));
+ EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc", outof(error_msg)));
+ EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*123*def", outof(error_msg)));
+ EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*def*", outof(error_msg)));
// Unsatisfiable dependency.
- EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*123*", &error_msg));
+ EXPECT_FALSE(OatFile::CheckStaticDexFileDependencies("abc*123*", outof(error_msg)));
// Load some dex files to be able to do a real test.
ScopedObjectAccess soa(Thread::Current());
@@ -92,10 +93,10 @@ TEST_F(OatFileTest, DexFileDependencies) {
std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Main");
std::vector<const DexFile*> dex_files_const1 = ToConstDexFiles(dex_files1);
std::string encoding1 = OatFile::EncodeDexFileDependencies(dex_files_const1);
- EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(encoding1.c_str(), &error_msg))
+ EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(encoding1.c_str(), outof(error_msg)))
<< error_msg << " " << encoding1;
std::vector<std::string> split1;
- EXPECT_TRUE(OatFile::GetDexLocationsFromDependencies(encoding1.c_str(), &split1));
+ EXPECT_TRUE(OatFile::GetDexLocationsFromDependencies(encoding1.c_str(), outof(split1)));
ASSERT_EQ(split1.size(), 1U);
EXPECT_EQ(split1[0], dex_files_const1[0]->GetLocation());
@@ -103,10 +104,10 @@ TEST_F(OatFileTest, DexFileDependencies) {
EXPECT_GT(dex_files2.size(), 1U);
std::vector<const DexFile*> dex_files_const2 = ToConstDexFiles(dex_files2);
std::string encoding2 = OatFile::EncodeDexFileDependencies(dex_files_const2);
- EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(encoding2.c_str(), &error_msg))
+ EXPECT_TRUE(OatFile::CheckStaticDexFileDependencies(encoding2.c_str(), outof(error_msg)))
<< error_msg << " " << encoding2;
std::vector<std::string> split2;
- EXPECT_TRUE(OatFile::GetDexLocationsFromDependencies(encoding2.c_str(), &split2));
+ EXPECT_TRUE(OatFile::GetDexLocationsFromDependencies(encoding2.c_str(), outof(split2)));
ASSERT_EQ(split2.size(), 2U);
EXPECT_EQ(split2[0], dex_files_const2[0]->GetLocation());
EXPECT_EQ(split2[1], dex_files_const2[1]->GetLocation());