From 9ca071b6e55568dff6960bebe1a5cfaa180fb3ce Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 10 Nov 2021 13:21:58 -0500 Subject: [PATCH] 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 --- docs/advanced.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/advanced.md b/docs/advanced.md index aea4feec..f2f8854b 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 ... }