Lines Matching refs:std
72 int GenerateOdexForTestWithStatus(const std::vector<std::string>& dex_locations, in GenerateOdexForTestWithStatus()
73 const std::string& odex_location, in GenerateOdexForTestWithStatus()
75 std::string* error_msg, in GenerateOdexForTestWithStatus()
76 const std::vector<std::string>& extra_args = {}, in GenerateOdexForTestWithStatus()
78 std::unique_ptr<File> oat_file;
79 std::vector<std::string> args;
81 for (const std::string& dex_location : dex_locations) {
87 args.push_back("--oat-fd=" + std::to_string(oat_file->Fd()));
110 const std::string& dex_location, in GenerateOdexForTest()
111 const std::string& odex_location, in GenerateOdexForTest()
113 const std::vector<std::string>& extra_args = {}, in GenerateOdexForTest()
129 const std::string& dex_location, in GenerateOdexForTest()
130 const std::string& odex_location, in GenerateOdexForTest()
132 const std::vector<std::string>& extra_args, in GenerateOdexForTest()
136 std::string error_msg; in GenerateOdexForTest()
147 << "Failed to compile odex: " << error_msg << std::endl << output_; in GenerateOdexForTest()
151 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in GenerateOdexForTest()
174 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in GenerateOdexForTest()
196 int Dex2Oat(const std::vector<std::string>& dex2oat_args, std::string* error_msg) { in Dex2Oat()
197 std::vector<std::string> argv; in Dex2Oat()
224 argv.push_back("--android-root=" + std::string(android_root)); in Dex2Oat()
227 std::string all_args; in Dex2Oat()
228 for (const std::string& arg : argv) { in Dex2Oat()
245 std::string output_ = "";
246 std::string error_msg_ = "";
252 void RunTest(bool use_fd, bool expect_use, const std::vector<std::string>& extra_args = {}) { in RunTest()
253 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
254 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
258 std::vector<std::string> copy(extra_args);
260 std::unique_ptr<ScratchFile> sf;
265 std::string swap_location = GetOdexDir() + "/Dex2OatSwapTest.odex.swap";
275 virtual std::string GetTestDexFileName() { in GetTestDexFileName()
296 EXPECT_NE(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
299 EXPECT_EQ(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
322 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
355 EXPECT_NE(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
358 EXPECT_EQ(output_.find("Large app, accepted running with swap."), std::string::npos) in CheckHostResult()
364 std::string GetTestDexFileName() override { in GetTestDexFileName()
374 native_alloc_1_ = std::numeric_limits<size_t>::max(); in GrabResult1()
385 swap_2_ = std::numeric_limits<size_t>::max(); in GrabResult2()
391 std::regex native_alloc_regex("dex2oat took.*native alloc=[^ ]+ \\(([0-9]+)B\\)"); in ParseNativeAlloc()
392 std::smatch native_alloc_match; in ParseNativeAlloc()
393 bool found = std::regex_search(output_, native_alloc_match, native_alloc_regex); in ParseNativeAlloc()
403 std::istringstream stream(native_alloc_match[1].str()); in ParseNativeAlloc()
411 std::regex swap_regex("dex2oat took[^\\n]+swap=[^ ]+ \\(([0-9]+)B\\)"); in ParseSwap()
412 std::smatch swap_match; in ParseSwap()
413 bool found = std::regex_search(output_, swap_match, swap_regex); in ParseSwap()
428 std::istringstream stream(swap_match[1].str()); in ParseSwap()
455 std::string output_1 = output_; in TEST_F()
463 std::string output_2 = output_; in TEST_F()
484 const std::vector<std::string>& extra_args = {}) { in RunTest()
485 std::string dex_location = GetScratchDir() + "/DexNoOat.jar";
486 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex";
487 std::string app_image_file = GetScratchDir() + "/Test.art";
491 std::vector<std::string> new_args(extra_args);
505 void CheckResult(const std::string& dex_location, in CheckResult()
506 const std::string& odex_location, in CheckResult()
507 const std::string& app_image_file, in CheckResult()
515 std::string error_msg; in CheckResult()
516 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in CheckResult()
526 std::unique_ptr<File> file(OS::OpenFileForReading(app_image_file.c_str())); in CheckResult()
535 std::unique_ptr<const DexFile> dex_file = oat_dex_file->OpenDexFile(&error_msg); in CheckResult()
538 ASSERT_LT(class_def_count, std::numeric_limits<uint16_t>::max()); in CheckResult()
575 EXPECT_NE(output_.find("Very large app, downgrading to"), std::string::npos) << output_; in CheckHostResult()
577 EXPECT_EQ(output_.find("Very large app, downgrading to"), std::string::npos) << output_; in CheckHostResult()
597 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
634 void GenerateProfile(const std::string& test_profile, in GenerateProfile()
635 const std::string& dex_location, in GenerateProfile()
644 std::string profile_key = ProfileCompilationInfo::GetProfileDexFileKey(dex_location); in GenerateProfile()
653 void CompileProfileOdex(const std::string& dex_location, in CompileProfileOdex()
654 const std::string& odex_location, in CompileProfileOdex()
655 const std::string& app_image_file_name, in CompileProfileOdex()
658 const std::vector<std::string>& extra_args = {}, in CompileProfileOdex()
660 const std::string profile_location = GetScratchDir() + "/primary.prof";
662 std::string error_msg;
663 std::vector<std::unique_ptr<const DexFile>> dex_files;
668 std::unique_ptr<const DexFile>& dex_file = dex_files[0];
673 std::vector<std::string> copy(extra_args);
675 std::unique_ptr<File> app_image_file;
679 copy.push_back("--app-image-fd=" + std::to_string(app_image_file->Fd()));
695 uint64_t GetImageObjectSectionSize(const std::string& image_file_name) { in GetImageObjectSectionSize()
697 std::unique_ptr<File> file(OS::OpenFileForReading(image_file_name.c_str())); in GetImageObjectSectionSize()
708 std::string dex_location = GetScratchDir() + "/DexNoOat.jar"; in RunTest()
709 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex"; in RunTest()
710 std::string app_image_file = app_image ? (GetOdexDir() + "/DexOdexNoOat.art"): ""; in RunTest()
745 std::string dex_location = GetScratchDir() + "/DexNoOat.jar"; in RunTestVDex()
746 std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex"; in RunTestVDex()
747 std::string vdex_location = GetOdexDir() + "/DexOdexNoOat.vdex"; in RunTestVDex()
748 std::string app_image_file_name = GetOdexDir() + "/DexOdexNoOat.art"; in RunTestVDex()
751 std::unique_ptr<File> vdex_file1(OS::CreateEmptyFile(vdex_location.c_str())); in RunTestVDex()
755 std::string input_vdex = "--input-vdex-fd=-1"; in RunTestVDex()
756 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file1->Fd()); in RunTestVDex()
767 std::string input_vdex = StringPrintf("--input-vdex-fd=%d", vdex_file1->Fd()); in RunTestVDex()
768 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file2.GetFd()); in RunTestVDex()
783 void CheckResult(const std::string& dex_location, in CheckResult()
784 const std::string& odex_location, in CheckResult()
785 const std::string& app_image_file_name) { in CheckResult()
787 std::string error_msg; in CheckResult()
788 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in CheckResult()
799 std::vector<std::unique_ptr<const DexFile>> dex_files; in CheckResult()
804 std::unique_ptr<const DexFile>& old_dex_file = dex_files[0]; in CheckResult()
807 std::unique_ptr<const DexFile> new_dex_file = oat_dex_file->OpenDexFile(&error_msg); in CheckResult()
810 ASSERT_LT(class_def_count, std::numeric_limits<uint16_t>::max()); in CheckResult()
814 std::string old_class0 = old_dex_file->PrettyType(old_dex_file->GetClassDef(0).class_idx_); in CheckResult()
815 std::string old_class1 = old_dex_file->PrettyType(old_dex_file->GetClassDef(1).class_idx_); in CheckResult()
816 std::string new_class0 = new_dex_file->PrettyType(new_dex_file->GetClassDef(0).class_idx_); in CheckResult()
817 std::string new_class1 = new_dex_file->PrettyType(new_dex_file->GetClassDef(1).class_idx_); in CheckResult()
826 std::unique_ptr<File> file(OS::OpenFileForReading(app_image_file_name.c_str())); in CheckResult()
850 EXPECT_NE(output_.find("dex2oat took"), std::string::npos) << output_; in CheckHostValidity()
869 std::string dex_location = GetScratchDir() + "/UnquickenMultiDex.jar"; in RunUnquickenMultiDex()
870 std::string odex_location = GetOdexDir() + "/UnquickenMultiDex.odex"; in RunUnquickenMultiDex()
871 std::string vdex_location = GetOdexDir() + "/UnquickenMultiDex.vdex"; in RunUnquickenMultiDex()
874 std::unique_ptr<File> vdex_file1(OS::CreateEmptyFile(vdex_location.c_str())); in RunUnquickenMultiDex()
878 std::string input_vdex = "--input-vdex-fd=-1"; in RunUnquickenMultiDex()
879 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file1->Fd()); in RunUnquickenMultiDex()
890 std::string input_vdex = StringPrintf("--input-vdex-fd=%d", vdex_file1->Fd()); in RunUnquickenMultiDex()
891 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file1->Fd()); in RunUnquickenMultiDex()
905 std::string dex_location = GetScratchDir() + "/UnquickenMultiDex.jar"; in RunUnquickenMultiDexCDex()
906 std::string odex_location = GetOdexDir() + "/UnquickenMultiDex.odex"; in RunUnquickenMultiDexCDex()
907 std::string odex_location2 = GetOdexDir() + "/UnquickenMultiDex2.odex"; in RunUnquickenMultiDexCDex()
908 std::string vdex_location = GetOdexDir() + "/UnquickenMultiDex.vdex"; in RunUnquickenMultiDexCDex()
909 std::string vdex_location2 = GetOdexDir() + "/UnquickenMultiDex2.vdex"; in RunUnquickenMultiDexCDex()
912 std::unique_ptr<File> vdex_file1(OS::CreateEmptyFile(vdex_location.c_str())); in RunUnquickenMultiDexCDex()
913 std::unique_ptr<File> vdex_file2(OS::CreateEmptyFile(vdex_location2.c_str())); in RunUnquickenMultiDexCDex()
919 std::string input_vdex = "--input-vdex-fd=-1"; in RunUnquickenMultiDexCDex()
920 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file1->Fd()); in RunUnquickenMultiDexCDex()
932 std::string input_vdex = StringPrintf("--input-vdex-fd=%d", vdex_file1->Fd()); in RunUnquickenMultiDexCDex()
933 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_file2->Fd()); in RunUnquickenMultiDexCDex()
947 void CheckResult(const std::string& dex_location, const std::string& odex_location) { in CheckResult()
948 std::string error_msg; in CheckResult()
949 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in CheckResult()
962 std::unique_ptr<const DexFile> dex_file = oat_dex_file->OpenDexFile(&error_msg); in CheckResult()
984 void RunTest(bool expect_success, const std::vector<std::string>& extra_args = {}) { in RunTest()
985 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
986 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
990 std::vector<std::string> copy(extra_args);
992 std::string swap_location = GetOdexDir() + "/Dex2OatSwapTest.odex.swap";
1002 std::string GetTestDexFileName() { in GetTestDexFileName()
1031 int RunTest(const std::vector<std::string>& extra_args = {}) { in RunTest()
1032 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
1033 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
1037 std::string error_msg;
1045 std::string GetTestDexFileName() { in GetTestDexFileName()
1063 std::string dex_location = GetUsedDexLocation(); in RunTest()
1064 std::string odex_location = GetUsedOatLocation(); in RunTest()
1068 std::string error_msg; in RunTest()
1069 std::vector<std::string> extra_args; in RunTest()
1071 extra_args.push_back(std::string("--class-loader-context=") + class_loader_context); in RunTest()
1074 extra_args.push_back(std::string("--app-image-file=") + GetUsedImageLocation()); in RunTest()
1092 std::string GetUsedDexLocation() { in GetUsedDexLocation()
1096 std::string GetUsedOatLocation() { in GetUsedOatLocation()
1100 std::string GetUsedImageLocation() { in GetUsedImageLocation()
1122 std::string context = "PCL[" + GetUsedDexLocation() + "]"; in TEST_F()
1127 std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles("Nested"); in TEST_F()
1129 std::string context = "PCL[" + dex_files[0]->GetLocation() + "]"; in TEST_F()
1130 std::string expected_classpath_key = "PCL[" + in TEST_F()
1131 dex_files[0]->GetLocation() + "*" + std::to_string(dex_files[0]->GetLocationChecksum()) + "]"; in TEST_F()
1136 std::string stripped_classpath = GetScratchDir() + "/stripped_classpath.jar"; in TEST_F()
1139 std::string context = "PCL[" + stripped_classpath + "]"; in TEST_F()
1145 std::string stripped_classpath = GetScratchDir() + "/stripped_classpath.jar"; in TEST_F()
1146 std::string odex_for_classpath = GetOdexDir() + "/stripped_classpath.odex"; in TEST_F()
1159 std::string context = "PCL[" + stripped_classpath + "]"; in TEST_F()
1160 std::string expected_classpath_key; in TEST_F()
1164 std::unique_ptr<OatFile> oat_file(oat_file_assistant.GetBestOatFile()); in TEST_F()
1165 std::vector<std::unique_ptr<const DexFile>> oat_dex_files = in TEST_F()
1173 std::to_string(oat_dex_files[i]->GetLocationChecksum()); in TEST_F()
1185 std::string context = "PCL[does_not_exists.dex]"; in TEST_F()
1191 std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Nested"); in TEST_F()
1192 std::vector<std::unique_ptr<const DexFile>> dex_files2 = OpenTestDexFiles("MultiDex"); in TEST_F()
1194 std::string context = "PCL[" + GetTestDexFileName("Nested") + "];" + in TEST_F()
1196 std::string expected_classpath_key = "PCL[" + CreateClassPathWithChecksums(dex_files1) + "];" + in TEST_F()
1203 std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Nested"); in TEST_F()
1204 std::vector<std::unique_ptr<const DexFile>> dex_files2 = OpenTestDexFiles("MultiDex"); in TEST_F()
1206 std::string context = "PCL[" + GetTestDexFileName("Nested") + "]" + in TEST_F()
1208 std::string expected_classpath_key = "PCL[" + CreateClassPathWithChecksums(dex_files1) + "]" + in TEST_F()
1214 std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Nested"); in TEST_F()
1215 std::vector<std::unique_ptr<const DexFile>> dex_files2 = OpenTestDexFiles("MultiDex"); in TEST_F()
1217 std::string context = "PCL[" + GetTestDexFileName("Nested") + "]" + in TEST_F()
1219 std::string expected_classpath_key = "PCL[" + CreateClassPathWithChecksums(dex_files1) + "]" + in TEST_F()
1229 std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Nested"); in TEST_F()
1230 std::vector<std::unique_ptr<const DexFile>> dex_files2 = OpenTestDexFiles("MultiDex"); in TEST_F()
1232 std::string context = "PCL[" + GetTestDexFileName("Nested") + "]" + in TEST_F()
1235 std::string expected_classpath_key = "PCL[" + CreateClassPathWithChecksums(dex_files1) + "]" + in TEST_F()
1246 std::vector<std::unique_ptr<const DexFile>> dex_files1 = OpenTestDexFiles("Nested"); in TEST_F()
1247 std::vector<std::unique_ptr<const DexFile>> dex_files2 = OpenTestDexFiles("MultiDex"); in TEST_F()
1249 std::string context = "PCL[" + GetTestDexFileName("Nested") + "]" + in TEST_F()
1252 std::string expected_classpath_key = "PCL[" + CreateClassPathWithChecksums(dex_files1) + "]" + in TEST_F()
1272 std::string out_dir = GetScratchDir(); in TEST_F()
1273 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1274 const std::string base_vdex_name = out_dir + "/base.vdex"; in TEST_F()
1275 const std::string unload_oat_name = out_dir + "/unload.oat"; in TEST_F()
1276 const std::string unload_vdex_name = out_dir + "/unload.vdex"; in TEST_F()
1277 const std::string no_unload_oat_name = out_dir + "/nounload.oat"; in TEST_F()
1278 const std::string no_unload_vdex_name = out_dir + "/nounload.vdex"; in TEST_F()
1279 const std::string app_image_name = out_dir + "/unload.art"; in TEST_F()
1280 std::string error_msg; in TEST_F()
1281 const std::vector<gc::space::ImageSpace*>& spaces = runtime->GetHeap()->GetBootImageSpaces(); in TEST_F()
1283 const std::string image_location = spaces[0]->GetImageLocation(); in TEST_F()
1294 std::unique_ptr<File> unload_oat(OS::OpenFileForReading(unload_oat_name.c_str())); in TEST_F()
1295 std::unique_ptr<File> unload_vdex(OS::OpenFileForReading(unload_vdex_name.c_str())); in TEST_F()
1311 std::unique_ptr<File> no_unload_oat(OS::OpenFileForReading(no_unload_oat_name.c_str())); in TEST_F()
1312 std::unique_ptr<File> no_unload_vdex(OS::OpenFileForReading(no_unload_vdex_name.c_str())); in TEST_F()
1325 std::unique_ptr<File> app_image_file(OS::OpenFileForReading(app_image_name.c_str())); in TEST_F()
1334 std::unique_ptr<const DexFile> dex(OpenTestDexFile("ManyMethods")); in TEST_F()
1338 std::vector<uint16_t> methods; in TEST_F()
1343 std::set<size_t> code_item_offsets; in TEST_F()
1354 std::vector<uint16_t> hot_methods = {methods[1], methods[3], methods[5]}; in TEST_F()
1355 std::vector<uint16_t> startup_methods = {methods[1], methods[2], methods[7]}; in TEST_F()
1356 std::vector<uint16_t> post_methods = {methods[0], methods[2], methods[6]}; in TEST_F()
1387 const std::string dir = GetScratchDir(); in TEST_F()
1388 const std::string oat_filename = dir + "/base.oat"; in TEST_F()
1389 const std::string vdex_filename = dir + "/base.vdex"; in TEST_F()
1390 std::string error_msg; in TEST_F()
1400 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1409 std::vector<const OatDexFile*> oat_dex_files = odex_file->GetOatDexFiles(); in TEST_F()
1438 std::unique_ptr<const DexFile> dex_file(oat_dex->OpenDexFile(&error_msg)); in TEST_F()
1496 const std::string dir = GetScratchDir(); in TEST_F()
1497 const std::string oat_filename = dir + "/base.oat"; in TEST_F()
1498 const std::string vdex_filename = dir + "/base.vdex"; in TEST_F()
1499 const std::string dex_location = GetTestDexFileName("MultiDex"); in TEST_F()
1500 std::string error_msg; in TEST_F()
1509 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1518 std::vector<const OatDexFile*> oat_dex_files = odex_file->GetOatDexFiles(); in TEST_F()
1521 std::vector<std::unique_ptr<const CompactDexFile>> compact_dex_files; in TEST_F()
1523 std::unique_ptr<const DexFile> dex_file(oat_dex->OpenDexFile(&error_msg)); in TEST_F()
1527 std::unique_ptr<const CompactDexFile>(dex_file.release()->AsCompactDexFile())); in TEST_F()
1529 for (const std::unique_ptr<const CompactDexFile>& dex_file : compact_dex_files) { in TEST_F()
1544 for (const std::unique_ptr<const CompactDexFile>& other_dex : compact_dex_files) { in TEST_F()
1558 std::unique_ptr<const DexFile> dex(OpenTestDexFile("VerifierDeps")); in TEST_F()
1559 std::string out_dir = GetScratchDir(); in TEST_F()
1560 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1561 std::string error_msg; in TEST_F()
1581 std::unique_ptr<const DexFile> dex(OpenTestDexFile("VerifierDepsMulti")); in TEST_F()
1582 std::string out_dir = GetScratchDir(); in TEST_F()
1583 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1584 std::string error_msg; in TEST_F()
1606 std::unique_ptr<const DexFile> dex(OpenTestDexFile("MyClassNatives")); in TEST_F()
1607 std::string out_dir = GetScratchDir(); in TEST_F()
1608 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1635 std::unique_ptr<const DexFile> dex(OpenTestDexFile("MainUncompressed")); in TEST_F()
1636 std::string out_dir = GetScratchDir(); in TEST_F()
1637 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1650 std::string out_dir = GetScratchDir(); in TEST_F()
1651 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1652 std::string error_msg; in TEST_F()
1666 std::string out_dir = GetScratchDir(); in TEST_F()
1667 const std::string base_oat_name = out_dir + "/base.oat"; in TEST_F()
1668 std::string error_msg; in TEST_F()
1745 std::unique_ptr<uint8_t[]> bytes(DecodeBase64(base64, &length)); in WriteBase64ToFile()
1755 std::string out_dir = GetScratchDir(); in TEST_F()
1756 const std::string oat_filename = out_dir + "/base.oat"; in TEST_F()
1768 std::string error_msg; in TEST_F()
1769 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1778 std::vector<const OatDexFile*> oat_dex_files = odex_file->GetOatDexFiles(); in TEST_F()
1782 std::unique_ptr<const DexFile> dex_file(oat_dex->OpenDexFile(&error_msg)); in TEST_F()
1797 std::unique_ptr<uint8_t[]> bytes(DecodeBase64(kDuplicateMethodInputDex, &length)); in TEST_F()
1801 std::unique_ptr<const DexFile> dex(OpenTestDexFile("ManyMethods")); in TEST_F()
1807 const std::string& dex_location = apk_file.GetFilename(); in TEST_F()
1808 const std::string odex_location = GetOdexDir() + "/output.odex"; in TEST_F()
1817 std::string dex_location = GetScratchDir() + "/Dex2OatStderrLoggerTest.jar"; in TEST_F()
1818 std::string odex_location = GetOdexDir() + "/Dex2OatStderrLoggerTest.odex"; in TEST_F()
1830 EXPECT_NE(std::string::npos, output_.find("dex2oat took")); in TEST_F()
1834 std::string dex_location = GetScratchDir() + "/Dex2OatCompilationReason.jar"; in TEST_F()
1835 std::string odex_location = GetOdexDir() + "/Dex2OatCompilationReason.odex"; in TEST_F()
1845 std::string error_msg; in TEST_F()
1846 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1859 std::string dex_location = GetScratchDir() + "/Dex2OatNoCompilationReason.jar"; in TEST_F()
1860 std::string odex_location = GetOdexDir() + "/Dex2OatNoCompilationReason.odex"; in TEST_F()
1870 std::string error_msg; in TEST_F()
1871 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1884 std::unique_ptr<const DexFile> dex(OpenTestDexFile("ManyMethods")); in TEST_F()
1885 std::string error_msg; in TEST_F()
1886 const std::string out_dir = GetScratchDir(); in TEST_F()
1887 const std::string dex_location = dex->GetLocation(); in TEST_F()
1888 const std::string odex_location = out_dir + "/base.oat"; in TEST_F()
1889 const std::string vdex_location = out_dir + "/base.vdex"; in TEST_F()
1899 std::unique_ptr<VdexFile> vdex(VdexFile::Open(vdex_location.c_str(), in TEST_F()
1907 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
1916 std::vector<const OatDexFile*> oat_dex_files = odex_file->GetOatDexFiles(); in TEST_F()
1920 std::unique_ptr<const DexFile> dex_file(oat_dex->OpenDexFile(&error_msg)); in TEST_F()
1927 std::unique_ptr<File> vdex_file(OS::OpenFileForReading(vdex_location.c_str())); in TEST_F()
1933 std::unique_ptr<uint8_t[]> bytes(new uint8_t[file->GetLength()]); in TEST_F()
1962 std::istringstream iss(output_); in TEST_F()
1963 std::string line; in TEST_F()
1965 const std::string kFastVerifyString = "Fast Verify"; in TEST_F()
1966 while (std::getline(iss, line) && !found_fast_verify) { in TEST_F()
1967 found_fast_verify = found_fast_verify || line.find(kFastVerifyString) != std::string::npos; in TEST_F()
1980 std::string error_msg; in TEST_F()
2000 const std::string& dex_location = temp_dex.GetFilename(); in TEST_F()
2001 std::string odex_location = GetOdexDir() + "/quickened.odex"; in TEST_F()
2002 std::string vdex_location = GetOdexDir() + "/quickened.vdex"; in TEST_F()
2003 std::unique_ptr<File> vdex_output(OS::CreateEmptyFile(vdex_location.c_str())); in TEST_F()
2006 std::string input_vdex = "--input-vdex-fd=-1"; in TEST_F()
2007 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_output->Fd()); in TEST_F()
2018 std::string odex_location2 = GetOdexDir() + "/unquickened.odex"; in TEST_F()
2019 std::string vdex_location2 = GetOdexDir() + "/unquickened.vdex"; in TEST_F()
2020 std::unique_ptr<File> vdex_unquickened(OS::CreateEmptyFile(vdex_location2.c_str())); in TEST_F()
2022 std::string input_vdex = StringPrintf("--input-vdex-fd=%d", vdex_output->Fd()); in TEST_F()
2023 std::string output_vdex = StringPrintf("--output-vdex-fd=%d", vdex_unquickened->Fd()); in TEST_F()
2037 std::unique_ptr<VdexFile> vdex(VdexFile::Open(vdex_location2.c_str(), in TEST_F()
2042 std::vector<std::unique_ptr<const DexFile>> dex_files; in TEST_F()
2076 const std::string& dex_location = invalid_dex.GetFilename(); in TEST_F()
2077 const std::string odex_location = GetOdexDir() + "/output.odex"; in TEST_F()
2078 std::string error_msg; in TEST_F()
2115 std::string error_msg; in TEST_F()
2137 const std::string out_dir = GetScratchDir(); in TEST_F()
2138 const std::string odex_location = out_dir + "/base.odex"; in TEST_F()
2142 { "--app-image-fd=" + std::to_string(app_image_file.GetFd()) }, in TEST_F()
2147 std::string error_msg; in TEST_F()
2148 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
2172 const std::string& dex_location = temp_dex.GetFilename(); in TEST_F()
2173 std::vector<uint16_t> methods; in TEST_F()
2174 std::vector<dex::TypeIndex> classes; in TEST_F()
2180 if (accessor.GetDescriptor() == std::string("LStringLiterals$StartupClass;")) { in TEST_F()
2184 std::string method_name(dex->GetMethodName(dex->GetMethodId(method.GetIndex()))); in TEST_F()
2217 std::unique_ptr<const DexFile> dex_file(OpenDexFile(temp_dex.GetFilename().c_str())); in TEST_F()
2228 const std::string out_dir = GetScratchDir(); in TEST_F()
2229 const std::string odex_location = out_dir + "/base.odex"; in TEST_F()
2230 const std::string app_image_location = out_dir + "/base.art"; in TEST_F()
2241 std::string error_msg; in TEST_F()
2242 std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, in TEST_F()
2254 std::unique_ptr<gc::space::ImageSpace> space = in TEST_F()
2259 std::set<std::string> seen; in TEST_F()
2268 std::set<std::string> preresolved_seen; in TEST_F()
2287 for (const std::string& str : preresolved_seen) { in TEST_F()
2306 std::set<std::string> boot_image_strings; in TEST_F()
2307 std::set<std::string> app_image_strings; in TEST_F()
2325 std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles("MultiDex"); in TEST_F()
2326 const std::string out_dir = GetScratchDir(); in TEST_F()
2327 const std::string odex_location = out_dir + "/base.odex"; in TEST_F()
2328 const std::string valid_context = "PCL[" + dex_files[0]->GetLocation() + "]"; in TEST_F()
2329 const std::string stored_context = "PCL[/system/not_real_lib.jar]"; in TEST_F()
2330 std::string expected_stored_context = "PCL["; in TEST_F()
2332 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in TEST_F()
2339 expected_stored_context += "!classes" + std::to_string(index) + ".dex"; in TEST_F()
2341 expected_stored_context += "*" + std::to_string(dex_file->GetLocationChecksum()); in TEST_F()
2371 void RunTest(const std::vector<std::string>& extra_args = {}) { in RunTest()
2372 std::string dex_location = GetScratchDir() + "/Dex2OatSwapTest.jar";
2373 std::string odex_location = GetOdexDir() + "/Dex2OatSwapTest.odex";
2383 std::string GetTestDexFileName() { in GetTestDexFileName()
2389 std::vector<std::string> argv; in TEST_F()
2392 std::find(std::begin(argv), std::end(argv), "--instruction-set-features=runtime"); in TEST_F()
2395 EXPECT_NE(option_pos, std::end(argv)); in TEST_F()
2397 EXPECT_EQ(option_pos, std::end(argv)); in TEST_F()