]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Clarify that `this->` is needed to access members of type-parameterized tests.
authorelixir <elixir@google.com>
Fri, 27 May 2022 18:31:26 +0000 (11:31 -0700)
committerCopybara-Service <copybara-worker@google.com>
Fri, 27 May 2022 18:32:10 +0000 (11:32 -0700)
PiperOrigin-RevId: 451439108
Change-Id: I8929df21d53cbe6c42e38653e1bb0cac72fc36f9

docs/advanced.md

index 7d81162fefbbe012d49e237548fb56419cd93a54..a89d837bbd7573e9836ef6d612a4385c7309fc45 100644 (file)
@@ -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()
   ...
 }