From d20e247caf801ae6418e4226a19dd98719a7af75 Mon Sep 17 00:00:00 2001 From: Pete Chou Date: Mon, 29 Dec 2014 21:05:19 +0800 Subject: Fix comparison between signed and unsigned integer expressions [-Werror=sign-compare]. Change-Id: Icfd4133b73c62d1ac7c9b076e5c3959219bb0671 --- unittests/ELFReaderTest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unittests/ELFReaderTest.cpp b/unittests/ELFReaderTest.cpp index b431be85..f6745d33 100644 --- a/unittests/ELFReaderTest.cpp +++ b/unittests/ELFReaderTest.cpp @@ -80,17 +80,17 @@ void ELFReaderTest::TearDown() { // Testcases //===----------------------------------------------------------------------===// TEST_F(ELFReaderTest, read_section_headers) { - ASSERT_EQ(m_pInput->context()->numOfSections(), 13); + ASSERT_EQ(m_pInput->context()->numOfSections(), 13u); LDContext::const_sect_iterator iter = m_pInput->context()->sectBegin(); ++iter; /// test section[1] ASSERT_EQ(".text", (*iter)->name()); ASSERT_EQ(llvm::ELF::SHT_PROGBITS, (*iter)->type()); - ASSERT_EQ(0x40, (*iter)->offset()); - ASSERT_EQ(0x15, (*iter)->size()); + ASSERT_EQ(0x40u, (*iter)->offset()); + ASSERT_EQ(0x15u, (*iter)->size()); ASSERT_TRUE(llvm::ELF::SHF_ALLOC & (*iter)->flag()); // AX - ASSERT_EQ(0x4, (*iter)->align()); + ASSERT_EQ(0x4u, (*iter)->align()); ASSERT_EQ(NULL, (*iter)->getLink()); - ASSERT_EQ(0, (*iter)->getInfo()); + ASSERT_EQ(0u, (*iter)->getInfo()); } TEST_F(ELFReaderTest, read_symbol_and_rela) { @@ -135,13 +135,13 @@ TEST_F(ELFReaderTest, read_symbol_and_rela) { const RelocData::RelocationListType& rRelocs = (*rs)->getRelocData()->getRelocationList(); RelocData::const_iterator rReloc = rRelocs.begin(); - ASSERT_EQ(2, rRelocs.size()); + ASSERT_EQ(2u, rRelocs.size()); ASSERT_TRUE(rRelocs.end() != rReloc); ++rReloc; /// test rRelocs[1] ASSERT_EQ("puts", std::string(rReloc->symInfo()->name())); ASSERT_EQ(llvm::ELF::R_X86_64_PC32, rReloc->type()); - ASSERT_EQ(0x0, rReloc->symValue()); - ASSERT_EQ(-0x4, rReloc->addend()); + ASSERT_EQ(0x0u, rReloc->symValue()); + ASSERT_EQ(static_cast(-0x4), rReloc->addend()); } TEST_F(ELFReaderTest, read_regular_sections) { -- cgit v1.2.3