Adds tests for EXPECT_FATAL_FAILURE and reduces the golden file bloat (by Zhanyong Wan). Fixes more warnings on Windows (by Vlad Losev).

This commit is contained in:
zhanyong.wan
2009-02-06 00:47:20 +00:00
parent ad99ca1446
commit 3750499433
7 changed files with 119 additions and 98 deletions

View File

@@ -3771,6 +3771,22 @@ int GetFailedPartCount(const TestResult* result) {
return result->failed_part_count();
}
// Used by the GTEST_HIDE_UNREACHABLE_CODE_ macro to suppress unreachable
// code warnings.
namespace {
class ClassUniqueToAlwaysTrue {};
}
bool AlwaysTrue() {
#if GTEST_HAS_EXCEPTIONS
// This condition is always false so AlwaysTrue() never actually throws,
// but it makes the compiler think that it may throw.
if (atoi("42") == 36) // NOLINT
throw ClassUniqueToAlwaysTrue();
#endif // GTEST_HAS_EXCEPTIONS
return true;
}
// Parses a string as a command line flag. The string should have
// the format "--flag=value". When def_optional is true, the "=value"
// part can be omitted.