summaryrefslogtreecommitdiff
path: root/runtime/class_loader_context_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-06-12 07:46:46 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-06-13 14:20:24 +0000
commit20f803bad38828a3e1d7754d7123971b7b42ddba (patch)
tree71408134bec25cfcc24e2d68af9b414a93ec4110 /runtime/class_loader_context_test.cc
parent155920b599580c86d341181cd544d14bbca32e76 (diff)
Use C++20 `string{,_view}::{starts,ends}_with()`, part 1.
Remove the header file `string_view_cpp20.h` and update all source files that previously used this header file. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iafcdfc838a97deed7fb3a37cc8afe1f7ee78306b
Diffstat (limited to 'runtime/class_loader_context_test.cc')
-rw-r--r--runtime/class_loader_context_test.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index ec7abb75ac..59740a71ec 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -29,7 +29,6 @@
#include "art_method-alloc-inl.h"
#include "base/dchecked_vector.h"
#include "base/stl_util.h"
-#include "base/string_view_cpp20.h"
#include "class_linker.h"
#include "class_root-inl.h"
#include "common_runtime_test.h"
@@ -210,7 +209,7 @@ class ClassLoaderContextTest : public CommonRuntimeTest {
// If the opened location is relative (it was open from a relative path without a
// classpath_dir) it might not match the expected location which is absolute in tests).
// So we compare the endings (the checksum will validate it's actually the same file).
- ASSERT_TRUE(EndsWith(expected_location, opened_location))
+ ASSERT_TRUE(expected_location.ends_with(opened_location))
<< expected_location << " " << opened_location;
} else {
ASSERT_EQ(expected_location, opened_location);
@@ -234,7 +233,7 @@ class ClassLoaderContextTest : public CommonRuntimeTest {
// If the opened location is relative (it was open from a relative path without a
// classpath_dir) it might not match the expected location which is absolute in tests).
// So we compare the endings (the checksum will validate it's actually the same file).
- ASSERT_TRUE(EndsWith(expected_location, opened_location))
+ ASSERT_TRUE(expected_location.ends_with(opened_location))
<< expected_location << " " << opened_location;
} else {
ASSERT_EQ(expected_location, opened_location);
@@ -377,7 +376,7 @@ class ClassLoaderContextTest : public CommonRuntimeTest {
// TODO We should somehow support this in all situations. b/72042237.
bool CreateRelativeString(const std::string& in, const char* cwd, std::string* out) {
int cwd_len = strlen(cwd);
- if (!android::base::StartsWith(in, cwd) || (cwd_len < 1)) {
+ if (!in.starts_with(cwd) || (cwd_len < 1)) {
return false;
}
bool contains_trailing_slash = (cwd[cwd_len - 1] == '/');