Commit 9ca071b6 authored by Abseil Team's avatar Abseil Team Committed by dinord
Browse files

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
parent 7f228847
...@@ -926,9 +926,11 @@ class FooTest : public testing::Test { ...@@ -926,9 +926,11 @@ class FooTest : public testing::Test {
void TearDown() override { ... } void TearDown() override { ... }
// Some expensive resource shared by all tests. // 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) { TEST_F(FooTest, Test1) {
... you can refer to shared_resource_ here ... ... you can refer to shared_resource_ here ...
} }
......
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