aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Chou <petechou@gmail.com>2014-12-29 21:05:19 +0800
committerLai Wei-Chih <Robert.Lai@mediatek.com>2014-12-30 13:09:15 +0800
commitd20e247caf801ae6418e4226a19dd98719a7af75 (patch)
tree64ce1ec1fe89a1975a9f0fa3d11805c138ba8a2e
parent7698f2063247a98662c51d1714a5571f55d4c746 (diff)
downloadmclinker-main.tar.gz
Fix comparison between signed and unsigned integer expressions [-Werror=sign-compare].HEADmastermain
Change-Id: Icfd4133b73c62d1ac7c9b076e5c3959219bb0671
-rw-r--r--unittests/ELFReaderTest.cpp16
1 files 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<mcld::Relocation::Address>(-0x4), rReloc->addend());
}
TEST_F(ELFReaderTest, read_regular_sections) {