Commit 6cd38237 authored by elixir's avatar elixir Committed by Copybara-Service
Browse files

Clarify that `this->` is needed to access members of type-parameterized tests.

PiperOrigin-RevId: 451439108
Change-Id: I8929df21d53cbe6c42e38653e1bb0cac72fc36f9
parent 28356773
...@@ -1313,6 +1313,7 @@ First, define a fixture class template, as we did with typed tests: ...@@ -1313,6 +1313,7 @@ First, define a fixture class template, as we did with typed tests:
```c++ ```c++
template <typename T> template <typename T>
class FooTest : public testing::Test { class FooTest : public testing::Test {
void DoSomethingInteresting();
... ...
}; };
``` ```
...@@ -1330,6 +1331,9 @@ this as many times as you want: ...@@ -1330,6 +1331,9 @@ this as many times as you want:
TYPED_TEST_P(FooTest, DoesBlah) { TYPED_TEST_P(FooTest, DoesBlah) {
// Inside a test, refer to TypeParam to get the type parameter. // Inside a test, refer to TypeParam to get the type parameter.
TypeParam n = 0; TypeParam n = 0;
// You will need to use `this` explicitly to refer to fixture members.
this->DoSomethingInteresting()
... ...
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment