summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2021-11-10 18:21:58 (GMT)
committerdinord <dino.radakovich@gmail.com>2021-11-10 22:21:19 (GMT)
commit9ca071b6e55568dff6960bebe1a5cfaa180fb3ce (patch)
tree486b284ba5ae323e24329f4d39457eea30c9d14e /docs
parent7f2288476bec1a2918f7eb187e464ec70a274fef (diff)
downloadgoogletest-9ca071b6e55568dff6960bebe1a5cfaa180fb3ce.zip
googletest-9ca071b6e55568dff6960bebe1a5cfaa180fb3ce.tar.gz
googletest-9ca071b6e55568dff6960bebe1a5cfaa180fb3ce.tar.bz2
Googletest export
Revert CL that updated example for SetUpTestSuite/TearDownTestSuite to initialize static member variables inline. It seems that non-const static data members for some reason still must be initialized out-of-line. PiperOrigin-RevId: 408913846
Diffstat (limited to 'docs')
-rw-r--r--docs/advanced.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/advanced.md b/docs/advanced.md
index aea4fee..f2f8854 100644
--- a/docs/advanced.md
+++ b/docs/advanced.md
@@ -926,9 +926,11 @@ class FooTest : public testing::Test {
void TearDown() override { ... }
// Some expensive resource shared by all tests.
- static T* shared_resource_ = nullptr;
+ static T* shared_resource_;
};
+T* FooTest::shared_resource_ = nullptr;
+
TEST_F(FooTest, Test1) {
... you can refer to shared_resource_ here ...
}