diff options
author | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-13 10:42:21 (GMT) |
---|---|---|
committer | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-13 10:42:21 (GMT) |
commit | 3280099951c51b7d2745bd840f2dd9d967cffcda (patch) | |
tree | 3f76ba85031bac42ebc77f99c49d48ae480964bb /googletest/src/gtest.cc | |
parent | 10f05a627c2da8d7de78da1b08f984ce8de398fb (diff) | |
parent | 08d5b1f33af8c18785fb8ca02792b5fac81e248f (diff) | |
download | googletest-3280099951c51b7d2745bd840f2dd9d967cffcda.zip googletest-3280099951c51b7d2745bd840f2dd9d967cffcda.tar.gz googletest-3280099951c51b7d2745bd840f2dd9d967cffcda.tar.bz2 |
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googletest/src/gtest.cc')
-rw-r--r-- | googletest/src/gtest.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 4dbeac8..b2ccd75 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5340,11 +5340,15 @@ OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() { return os_stack_trace_getter_; } -// Returns the TestResult for the test that's currently running, or -// the TestResult for the ad hoc test if no test is running. +// Returns the most specific TestResult currently running. TestResult* UnitTestImpl::current_test_result() { - return current_test_info_ ? - &(current_test_info_->result_) : &ad_hoc_test_result_; + if (current_test_info_ != NULL) { + return ¤t_test_info_->result_; + } + if (current_test_case_ != NULL) { + return ¤t_test_case_->ad_hoc_test_result_; + } + return &ad_hoc_test_result_; } // Shuffles all test cases, and the tests within each test case, |