Googletest export
Update example for SetUpTestSuite/TearDownTestSuite to use modern C++ standards.
Currently it is using an outdated C++ construct (defining static member variables separately from the declaration).
PiperOrigin-RevId: 408663014
diff --git a/docs/advanced.md b/docs/advanced.md
index f2f8854..aea4fee 100644
--- a/docs/advanced.md
+++ b/docs/advanced.md
@@ -926,11 +926,9 @@
void TearDown() override { ... }
// Some expensive resource shared by all tests.
- static T* shared_resource_;
+ static T* shared_resource_ = nullptr;
};
-T* FooTest::shared_resource_ = nullptr;
-
TEST_F(FooTest, Test1) {
... you can refer to shared_resource_ here ...
}