mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
win: Fix -Wsign-compare warnings produced by clang
../../third_party/crashpad/crashpad/util/file/filesystem_test_util.cc(79,27): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] if (symbolic_link_flags == -1) { ~~~~~~~~~~~~~~~~~~~ ^ ~~ In file included from ../../third_party/crashpad/crashpad/util/file/filesystem_test_util.cc:23: ../../third_party/googletest/src/googletest/include\gtest/gtest.h(1392,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare] if (lhs == rhs) { ~~~ ^ ~~~ ../../third_party/googletest/src/googletest/include\gtest/gtest.h(1421,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); ^ ../../third_party/crashpad/crashpad/util/file/filesystem_test_util.cc(73,5): note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, long>' requested here EXPECT_EQ(error, ERROR_PRIVILEGE_NOT_HELD) ^ ../../third_party/googletest/src/googletest/include\gtest/gtest.h(1924,63): note: expanded from macro 'EXPECT_EQ' EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \ ^ 2 errors generated. and ../../third_party/crashpad/crashpad/util/file/filesystem_test_util.cc(111,5): note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, long>' requested here EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND) ^ Change-Id: I55b33b39c271d765376ff9c416e737d0608eb781 Reviewed-on: https://chromium-review.googlesource.com/742561 Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
692488a254
commit
3fae8ff07c
@ -34,10 +34,10 @@
|
||||
int main(int argc, char* argv[]) {
|
||||
crashpad::test::InitializeMainArguments(argc, argv);
|
||||
|
||||
#if defined(CRASHPAD_TEST_LAUNCHER_GTEST)
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
#elif defined(CRASHPAD_TEST_LAUNCHER_GMOCK)
|
||||
#if defined(CRASHPAD_TEST_LAUNCHER_GMOCK)
|
||||
testing::InitGoogleMock(&argc, argv);
|
||||
#elif defined(CRASHPAD_TEST_LAUNCHER_GTEST)
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
#else // CRASHPAD_TEST_LAUNCHER_GTEST
|
||||
#error #define CRASHPAD_TEST_LAUNCHER_GTEST or CRASHPAD_TEST_LAUNCHER_GMOCK
|
||||
#endif // CRASHPAD_TEST_LAUNCHER_GTEST
|
||||
|
@ -70,13 +70,12 @@ bool SymbolicLinkFlags(DWORD* flags) {
|
||||
|
||||
// Don’t use ErrorMessage() here because the second CreateSymbolicLink() may
|
||||
// have scrambled it. Use the saved |error| value instead.
|
||||
EXPECT_EQ(error, ERROR_PRIVILEGE_NOT_HELD)
|
||||
<< "CreateSymbolicLink: "
|
||||
<< logging::SystemErrorCodeToString(GetLastError());
|
||||
EXPECT_EQ(error, static_cast<DWORD>(ERROR_PRIVILEGE_NOT_HELD))
|
||||
<< "CreateSymbolicLink: " << logging::SystemErrorCodeToString(error);
|
||||
return -1;
|
||||
}();
|
||||
|
||||
if (symbolic_link_flags == -1) {
|
||||
if (symbolic_link_flags == static_cast<DWORD>(-1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -108,7 +107,7 @@ bool PathExists(const base::FilePath& path) {
|
||||
return true;
|
||||
#elif defined(OS_WIN)
|
||||
if (GetFileAttributes(path.value().c_str()) == INVALID_FILE_ATTRIBUTES) {
|
||||
EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND)
|
||||
EXPECT_EQ(GetLastError(), static_cast<DWORD>(ERROR_FILE_NOT_FOUND))
|
||||
<< ErrorMessage("GetFileAttributes ")
|
||||
<< base::UTF16ToUTF8(path.value());
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user