summaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-internal.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-30 20:23:50 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-30 20:23:50 (GMT)
commitf8b268ee86ca74bba3276352f1e7de53d1336c3e (patch)
tree37e8c4680f5f6763c18aaa2739446c8ba08501f4 /include/gtest/internal/gtest-internal.h
parentb50ef44a3527d958270ff1f08cb99e3ac633bd17 (diff)
downloadgoogletest-f8b268ee86ca74bba3276352f1e7de53d1336c3e.zip
googletest-f8b268ee86ca74bba3276352f1e7de53d1336c3e.tar.gz
googletest-f8b268ee86ca74bba3276352f1e7de53d1336c3e.tar.bz2
Makes gtest compile cleanly with MSVC's /W4 (by Zhanyong Wan).
Renames EventListenrs to TestEventListeners (by Zhanyong Wan). Fixes invalid characters in XML report (by Vlad Losev). Refacotrs SConscript (by Vlad Losev).
Diffstat (limited to 'include/gtest/internal/gtest-internal.h')
-rw-r--r--include/gtest/internal/gtest-internal.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h
index f5c30fb..7033b0c 100644
--- a/include/gtest/internal/gtest-internal.h
+++ b/include/gtest/internal/gtest-internal.h
@@ -745,9 +745,15 @@ class TypeParameterizedTestCase<Fixture, Templates0, Types> {
// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test, int skip_count);
-// A helper for suppressing warnings on unreachable code in some macros.
+// Helpers for suppressing warnings on unreachable code or constant
+// condition.
+
+// Always returns true.
bool AlwaysTrue();
+// Always returns false.
+inline bool AlwaysFalse() { return !AlwaysTrue(); }
+
// A simple Linear Congruential Generator for generating random
// numbers with a uniform distribution. Unlike rand() and srand(), it
// doesn't use global state (and therefore can't interfere with user
@@ -854,7 +860,7 @@ class Random {
#define GTEST_TEST_BOOLEAN_(boolexpr, booltext, actual, expected, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (boolexpr) \
+ if (::testing::internal::IsTrue(boolexpr)) \
; \
else \
fail("Value of: " booltext "\n Actual: " #actual "\nExpected: " #expected)