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
This commit is contained in:
parent
7f2288476b
commit
9ca071b6e5
@ -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 ...
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user