diff options
author | 2023-03-30 12:35:16 +0000 | |
---|---|---|
committer | 2023-04-05 11:04:51 +0000 | |
commit | ba87ab5ca06eb85300b3b63f420914f76843a4a5 (patch) | |
tree | b86b5946911a42bc1bcc3cac6321e765219371c4 /runtime/oat_file_test.cc | |
parent | 2bb753eabb80ad9ed90dfef3693c1e72d3d9f689 (diff) |
Fix "readability-redundant-string-cstr" clang-tidy issues
Bug: 264654008
Test: m tidy-art
Change-Id: Ic852d58f106187791fa3a0d31829654de41bcb2b
Diffstat (limited to 'runtime/oat_file_test.cc')
-rw-r--r-- | runtime/oat_file_test.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/runtime/oat_file_test.cc b/runtime/oat_file_test.cc index f33235732a..80265f77f5 100644 --- a/runtime/oat_file_test.cc +++ b/runtime/oat_file_test.cc @@ -18,17 +18,15 @@ #include <string> -#include <gtest/gtest.h> - #include "common_runtime_test.h" #include "dexopt_test.h" +#include "gtest/gtest.h" #include "scoped_thread_state_change-inl.h" #include "vdex_file.h" namespace art { -class OatFileTest : public DexoptTest { -}; +class OatFileTest : public DexoptTest {}; TEST_F(OatFileTest, LoadOat) { std::string dex_location = GetScratchDir() + "/LoadOat.jar"; @@ -39,12 +37,13 @@ TEST_F(OatFileTest, LoadOat) { std::string oat_location; std::string error_msg; ASSERT_TRUE(OatFileAssistant::DexLocationToOatFilename( - dex_location, kRuntimeISA, &oat_location, &error_msg)) << error_msg; - std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, - oat_location.c_str(), - oat_location.c_str(), - /*executable=*/ false, - /*low_4gb=*/ false, + dex_location, kRuntimeISA, &oat_location, &error_msg)) + << error_msg; + std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/-1, + oat_location, + oat_location, + /*executable=*/false, + /*low_4gb=*/false, dex_location, &error_msg)); ASSERT_TRUE(odex_file.get() != nullptr); @@ -62,15 +61,16 @@ TEST_F(OatFileTest, ChangingMultiDexUncompressed) { std::string oat_location; std::string error_msg; ASSERT_TRUE(OatFileAssistant::DexLocationToOatFilename( - dex_location, kRuntimeISA, &oat_location, &error_msg)) << error_msg; + dex_location, kRuntimeISA, &oat_location, &error_msg)) + << error_msg; // Ensure we can load that file. Just a precondition. { - std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, - oat_location.c_str(), - oat_location.c_str(), - /*executable=*/ false, - /*low_4gb=*/ false, + std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/-1, + oat_location, + oat_location, + /*executable=*/false, + /*low_4gb=*/false, dex_location, &error_msg)); ASSERT_TRUE(odex_file != nullptr); @@ -81,11 +81,11 @@ TEST_F(OatFileTest, ChangingMultiDexUncompressed) { Copy(GetTestDexFileName("MainUncompressedAligned"), dex_location); // And try to load again. - std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/ -1, + std::unique_ptr<OatFile> odex_file(OatFile::Open(/*zip_fd=*/-1, oat_location, oat_location, - /*executable=*/ false, - /*low_4gb=*/ false, + /*executable=*/false, + /*low_4gb=*/false, dex_location, &error_msg)); EXPECT_TRUE(odex_file == nullptr); |