mirror of
https://github.com/google/googletest.git
synced 2025-01-14 08:27:56 +08:00
Googletest export
Modify NULL to nullptr in code examples PiperOrigin-RevId: 314150792
This commit is contained in:
parent
859bfe8981
commit
df6813f5e0
@ -1006,7 +1006,7 @@ TEST(FooTest, Bar) {
|
|||||||
// in Subroutine() to abort the entire test.
|
// in Subroutine() to abort the entire test.
|
||||||
|
|
||||||
// The actual behavior: the function goes on after Subroutine() returns.
|
// The actual behavior: the function goes on after Subroutine() returns.
|
||||||
int* p = NULL;
|
int* p = nullptr;
|
||||||
*p = 3; // Segfault!
|
*p = 3; // Segfault!
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -1193,7 +1193,7 @@ class FooTest : public ::testing::Test {
|
|||||||
// Can be omitted if not needed.
|
// Can be omitted if not needed.
|
||||||
static void TearDownTestSuite() {
|
static void TearDownTestSuite() {
|
||||||
delete shared_resource_;
|
delete shared_resource_;
|
||||||
shared_resource_ = NULL;
|
shared_resource_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can define per-test set-up logic as usual.
|
// You can define per-test set-up logic as usual.
|
||||||
@ -1206,7 +1206,7 @@ class FooTest : public ::testing::Test {
|
|||||||
static T* shared_resource_;
|
static T* shared_resource_;
|
||||||
};
|
};
|
||||||
|
|
||||||
T* FooTest::shared_resource_ = NULL;
|
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