diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-01-29 06:49:00 (GMT) |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-01-29 06:49:00 (GMT) |
commit | 4b83461e9772cce62e84310060fe84172e9bf4ba (patch) | |
tree | 81c398e25c7db78187ecb3c6a756b9996140943b /test | |
parent | c946ae60194727ede9d3ef44754839f48541a981 (diff) | |
download | googletest-4b83461e9772cce62e84310060fe84172e9bf4ba.zip googletest-4b83461e9772cce62e84310060fe84172e9bf4ba.tar.gz googletest-4b83461e9772cce62e84310060fe84172e9bf4ba.tar.bz2 |
Fixes some warnings when compiled with MSVC at warning level 4.
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-filepath_test.cc | 2 | ||||
-rw-r--r-- | test/gtest_unittest.cc | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/gtest-filepath_test.cc b/test/gtest-filepath_test.cc index 589442f..ee80f0d 100644 --- a/test/gtest-filepath_test.cc +++ b/test/gtest-filepath_test.cc @@ -311,7 +311,7 @@ TEST(RemoveTrailingPathSeparatorTest, ShouldReturnUnmodified) { TEST(DirectoryTest, RootDirectoryExists) { #ifdef GTEST_OS_WINDOWS // We are on Windows. char current_drive[_MAX_PATH]; // NOLINT - current_drive[0] = _getdrive() + 'A' - 1; + current_drive[0] = static_cast<char>(_getdrive() + 'A' - 1); current_drive[1] = ':'; current_drive[2] = '\\'; current_drive[3] = '\0'; diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index 135493f..cf9163b 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -1090,7 +1090,7 @@ TEST(TestResultPropertyTest, OverridesValuesForDuplicateKeys) { // property is not recorded. void ExpectNonFatalFailureRecordingPropertyWithReservedKey(const char* key) { TestResult test_result; - TestProperty property("name", "1"); + TestProperty property(key, "1"); EXPECT_NONFATAL_FAILURE(test_result.RecordProperty(property), "Reserved key"); ASSERT_TRUE(test_result.test_properties().IsEmpty()) << "Not recorded"; } @@ -1594,31 +1594,31 @@ TEST(PredicateAssertionTest, AcceptsTemplateFunction) { // Some helper functions for testing using overloaded/template // functions with ASSERT_PRED_FORMATn and EXPECT_PRED_FORMATn. -AssertionResult IsPositiveFormat(const char* expr, int n) { +AssertionResult IsPositiveFormat(const char* /* expr */, int n) { return n > 0 ? AssertionSuccess() : AssertionFailure(Message() << "Failure"); } -AssertionResult IsPositiveFormat(const char* expr, double x) { +AssertionResult IsPositiveFormat(const char* /* expr */, double x) { return x > 0 ? AssertionSuccess() : AssertionFailure(Message() << "Failure"); } template <typename T> -AssertionResult IsNegativeFormat(const char* expr, T x) { +AssertionResult IsNegativeFormat(const char* /* expr */, T x) { return x < 0 ? AssertionSuccess() : AssertionFailure(Message() << "Failure"); } template <typename T1, typename T2> -AssertionResult EqualsFormat(const char* expr1, const char* expr2, +AssertionResult EqualsFormat(const char* /* expr1 */, const char* /* expr2 */, const T1& x1, const T2& x2) { return x1 == x2 ? AssertionSuccess() : AssertionFailure(Message() << "Failure"); } // Tests that overloaded functions can be used in *_PRED_FORMAT* -// without explictly specifying their types. +// without explicitly specifying their types. TEST(PredicateFormatAssertionTest, AcceptsOverloadedFunction) { EXPECT_PRED_FORMAT1(IsPositiveFormat, 5); ASSERT_PRED_FORMAT1(IsPositiveFormat, 6.0); |