summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorelixir <elixir@google.com>2022-05-27 11:31:26 -0700
committerCopybara-Service <copybara-worker@google.com>2022-05-27 11:32:10 -0700
commit6cd3823783082f1d78031ca8e3df5850532c58a7 (patch)
tree1f406f5fd2985b9429f4ea0c13d85bd0fe9a3f2c /docs
parent28356773cbc429eb9d62ab0bf311c9979fa301fd (diff)
downloadgoogletest-git-6cd3823783082f1d78031ca8e3df5850532c58a7.tar.gz
Clarify that `this->` is needed to access members of type-parameterized tests.
PiperOrigin-RevId: 451439108 Change-Id: I8929df21d53cbe6c42e38653e1bb0cac72fc36f9
Diffstat (limited to 'docs')
-rw-r--r--docs/advanced.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/advanced.md b/docs/advanced.md
index 7d81162f..a89d837b 100644
--- a/docs/advanced.md
+++ b/docs/advanced.md
@@ -1313,6 +1313,7 @@ First, define a fixture class template, as we did with typed tests:
```c++
template <typename T>
class FooTest : public testing::Test {
+ void DoSomethingInteresting();
...
};
```
@@ -1330,6 +1331,9 @@ this as many times as you want:
TYPED_TEST_P(FooTest, DoesBlah) {
// Inside a test, refer to TypeParam to get the type parameter.
TypeParam n = 0;
+
+ // You will need to use `this` explicitly to refer to fixture members.
+ this->DoSomethingInteresting()
...
}