summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-03-23 19:53:07 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-03-23 19:53:07 (GMT)
commit17e4860871d225bce440a3ca9ef1bdaceaed60d8 (patch)
tree2fea0b6700e66fd71c920f04a3a7d85874b764cc
parente9f093ae15ac232f7ac0a31d64a5873fd1e306c6 (diff)
downloadgoogletest-17e4860871d225bce440a3ca9ef1bdaceaed60d8.zip
googletest-17e4860871d225bce440a3ca9ef1bdaceaed60d8.tar.gz
googletest-17e4860871d225bce440a3ca9ef1bdaceaed60d8.tar.bz2
Enables death tests on AIX, by Hady Zalek.
-rw-r--r--include/gtest/internal/gtest-port.h3
-rw-r--r--src/gtest.cc4
2 files changed, 6 insertions, 1 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 1db20a2..a5f432c 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -478,7 +478,8 @@
// abort() in a VC 7.1 application compiled as GUI in debug config
// pops up a dialog window that cannot be suppressed programmatically.
#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || GTEST_OS_WINDOWS_MINGW)
+ (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
+ GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX)
#define GTEST_HAS_DEATH_TEST 1
#include <vector> // NOLINT
#endif
diff --git a/src/gtest.cc b/src/gtest.cc
index 987e690..342d458 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -1805,6 +1805,8 @@ TestResult::~TestResult() {
// range from 0 to total_part_count() - 1. If i is not in that range,
// aborts the program.
const TestPartResult& TestResult::GetTestPartResult(int i) const {
+ if (i < 0 || i >= total_part_count())
+ internal::posix::Abort();
return test_part_results_.at(i);
}
@@ -1812,6 +1814,8 @@ const TestPartResult& TestResult::GetTestPartResult(int i) const {
// test_property_count() - 1. If i is not in that range, aborts the
// program.
const TestProperty& TestResult::GetTestProperty(int i) const {
+ if (i < 0 || i >= test_property_count())
+ internal::posix::Abort();
return test_properties_.at(i);
}