summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authormisterg <misterg@google.com>2018-08-22 16:30:23 -0400
committerGennadiy Civil <misterg@google.com>2018-08-23 16:03:46 -0400
commit87494afca70c50e62d1915830169558d25ce67a5 (patch)
tree83974344e47119f9363ec654f67c1b839b510b80 /googletest/src
parent9dae300121bebe41d93d44926a8de513f6d2d240 (diff)
downloadgoogletest-87494afca70c50e62d1915830169558d25ce67a5.tar.gz
googletest-87494afca70c50e62d1915830169558d25ce67a5.zip
Googletest export
Remove unneeded check for NULL. Note: this started as OSS PR https://github.com/google/googletest/pull/967 but changed PiperOrigin-RevId: 209819732
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 888ffd1b..e9127a11 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2679,18 +2679,18 @@ void TestInfo::Run() {
factory_, &internal::TestFactoryBase::CreateTest,
"the test fixture's constructor");
- // Runs the test only if the test object was created and its
- // constructor didn't generate a fatal failure.
- if ((test != NULL) && !Test::HasFatalFailure()) {
+ // Runs the test if the constructor didn't generate a fatal failure.
+ // Note that the object will not be null
+ if (!Test::HasFatalFailure()) {
// This doesn't throw as all user code that can throw are wrapped into
// exception handling code.
test->Run();
}
- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
+ // Deletes the test object.
+ impl->os_stack_trace_getter()->UponLeavingGTest();
+ internal::HandleExceptionsInMethodIfSupported(
+ test, &Test::DeleteSelf_, "the test fixture's destructor");
result_.set_elapsed_time(internal::GetTimeInMillis() - start);
OpenPOWER on IntegriCloud