aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/gtest.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-01-29 06:49:00 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-01-29 06:49:00 +0000
commit4b83461e9772cce62e84310060fe84172e9bf4ba (patch)
tree81c398e25c7db78187ecb3c6a756b9996140943b /include/gtest/gtest.h
parentc946ae60194727ede9d3ef44754839f48541a981 (diff)
downloadgoogletest-4b83461e9772cce62e84310060fe84172e9bf4ba.tar.gz
googletest-4b83461e9772cce62e84310060fe84172e9bf4ba.tar.bz2
googletest-4b83461e9772cce62e84310060fe84172e9bf4ba.zip
Fixes some warnings when compiled with MSVC at warning level 4.
Diffstat (limited to 'include/gtest/gtest.h')
-rw-r--r--include/gtest/gtest.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h
index dfa338b2..f1184dee 100644
--- a/include/gtest/gtest.h
+++ b/include/gtest/gtest.h
@@ -614,10 +614,20 @@ AssertionResult CmpHelperEQ(const char* expected_expression,
const char* actual_expression,
const T1& expected,
const T2& actual) {
+#ifdef _MSC_VER
+#pragma warning(push) // Saves the current warning state.
+#pragma warning(disable:4389) // Temporarily disables warning on
+ // signed/unsigned mismatch.
+#endif
+
if (expected == actual) {
return AssertionSuccess();
}
+#ifdef _MSC_VER
+#pragma warning(pop) // Restores the warning state.
+#endif
+
return EqFailure(expected_expression,
actual_expression,
FormatForComparisonFailureMessage(expected, actual),
@@ -688,7 +698,7 @@ class EqHelper<true> {
template <typename T1, typename T2>
static AssertionResult Compare(const char* expected_expression,
const char* actual_expression,
- const T1& expected,
+ const T1& /* expected */,
T2* actual) {
// We already know that 'expected' is a null pointer.
return CmpHelperEQ(expected_expression, actual_expression,
@@ -1315,7 +1325,7 @@ bool StaticAssertTypeEq() {
// value, as it always calls GetTypeId<>() from the Google Test
// framework.
#define TEST(test_case_name, test_name)\
- GTEST_TEST_(test_case_name, test_name,\
+ GTEST_TEST_(test_case_name, test_name, \
::testing::Test, ::testing::internal::GetTestTypeId())
@@ -1346,7 +1356,7 @@ bool StaticAssertTypeEq() {
// }
#define TEST_F(test_fixture, test_name)\
- GTEST_TEST_(test_fixture, test_name, test_fixture,\
+ GTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>())
// Use this macro in main() to run all tests. It returns 0 if all