From bad9e55ea52abd1bb759b800d85aa8952e315af1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 26 May 2016 10:09:46 -0400 Subject: fix signed warning errors in unittests A bunch of gtest assert statements fail due to signed warnings as unadorned constants are treated as signed integers. Mark them all unsigned to avoid that. One example (focus on the "[with ...]" blocks that show the types): In file included from src/breakpad_googletest_includes.h:33:0, from src/common/memory_unittest.cc:30: src/testing/gtest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]': src/testing/gtest/include/gtest/gtest.h:1524:23: required from 'static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type = void]' src/common/memory_unittest.cc:41:246: required from here src/testing/gtest/include/gtest/gtest.h:1448:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (expected == actual) { ^ cc1plus: some warnings being treated as errors Makefile:5180: recipe for target 'src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o' failed make[2]: *** [src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o] Error 1 R=ted.mielczarek@gmail.com Review URL: https://codereview.chromium.org/2013893003 . --- src/processor/minidump_processor_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/processor') diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 609a2a68..d43c1fc9 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -414,7 +414,7 @@ TEST_F(MinidumpProcessorTest, TestBasicProcessing) { ASSERT_EQ(state.crash_reason(), "EXCEPTION_ACCESS_VIOLATION_WRITE"); ASSERT_EQ(state.crash_address(), 0x45U); ASSERT_EQ(state.threads()->size(), size_t(1)); - EXPECT_EQ((*state.threads())[0]->tid(), 3060); + EXPECT_EQ((*state.threads())[0]->tid(), 3060U); ASSERT_EQ(state.requesting_thread(), 0); EXPECT_EQ(1171480435U, state.time_date_stamp()); EXPECT_EQ(1171480435U, state.process_create_time()); -- cgit v1.2.1