summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2023-03-24 05:57:22 -0700
committerCopybara-Service <copybara-worker@google.com>2023-03-24 05:58:11 -0700
commite9fb5c7bacc4a25b030569c92ff9f6925288f1c3 (patch)
tree77c8a868f62b63d306353ac943b6def9a047a6d1
parenta0ced33ac6df214966bb90ba036e0a5666dca14e (diff)
downloadgoogletest-git-e9fb5c7bacc4a25b030569c92ff9f6925288f1c3.tar.gz
Replace `const char*` with `absl::string_view` as the latter is preferred.
PiperOrigin-RevId: 519122695 Change-Id: I7dcf969d15d26ccc4b376e3ab6db7f4c08c7386f
-rw-r--r--docs/advanced.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/advanced.md b/docs/advanced.md
index d0369237..3871db13 100644
--- a/docs/advanced.md
+++ b/docs/advanced.md
@@ -1066,7 +1066,7 @@ they must be declared **public** rather than **protected** in order to use
```c++
class FooTest :
- public testing::TestWithParam<const char*> {
+ public testing::TestWithParam<absl::string_view> {
// You can implement all the usual fixture class members here.
// To access the test parameter, call GetParam() from class
// TestWithParam<T>.
@@ -1077,7 +1077,7 @@ class BaseTest : public testing::Test {
...
};
class BarTest : public BaseTest,
- public testing::WithParamInterface<const char*> {
+ public testing::WithParamInterface<absl::string_view> {
...
};
```
@@ -1148,8 +1148,8 @@ with parameter values `"cat"` and `"dog"` using the
[`ValuesIn`](reference/testing.md#param-generators) parameter generator:
```c++
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_SUITE_P(Pets, FooTest, testing::ValuesIn(pets));
+constexpr absl::string_view kPets[] = {"cat", "dog"};
+INSTANTIATE_TEST_SUITE_P(Pets, FooTest, testing::ValuesIn(kPets));
```
The tests from the instantiation above will have these names: