Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: test/unittests/eh-frame-writer-unittest.cc

Issue 2493173002: [turbofan] Fix more -Wsign-compare warnings. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/unittests/eh-frame-iterator-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/eh-frame-writer-unittest.cc
diff --git a/test/unittests/eh-frame-writer-unittest.cc b/test/unittests/eh-frame-writer-unittest.cc
index 98503986aa708e9a277fdfde0992710efa5d9dcc..13b970f4483006e7bd5bc50176f56974e5b5775c 100644
--- a/test/unittests/eh-frame-writer-unittest.cc
+++ b/test/unittests/eh-frame-writer-unittest.cc
@@ -75,7 +75,7 @@ TEST_F(EhFrameWriterTest, FDEHeader) {
}
TEST_F(EhFrameWriterTest, SetOffset) {
- static const int kOffset = 0x0badc0de;
+ static const uint32_t kOffset = 0x0badc0de;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -91,8 +91,8 @@ TEST_F(EhFrameWriterTest, SetOffset) {
}
TEST_F(EhFrameWriterTest, IncreaseOffset) {
- static const int kFirstOffset = 121;
- static const int kSecondOffset = 16;
+ static const uint32_t kFirstOffset = 121;
+ static const uint32_t kSecondOffset = 16;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -125,12 +125,13 @@ TEST_F(EhFrameWriterTest, SetRegister) {
EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfaRegister,
iterator.GetNextOpcode());
- EXPECT_EQ(kTestRegisterCode, iterator.GetNextULeb128());
+ EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
+ iterator.GetNextULeb128());
}
TEST_F(EhFrameWriterTest, SetRegisterAndOffset) {
Register test_register = Register::from_code(kTestRegisterCode);
- static const int kOffset = 0x0badc0de;
+ static const uint32_t kOffset = 0x0badc0de;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -141,7 +142,8 @@ TEST_F(EhFrameWriterTest, SetRegisterAndOffset) {
iterator.SkipToFdeDirectives();
EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfa, iterator.GetNextOpcode());
- EXPECT_EQ(kTestRegisterCode, iterator.GetNextULeb128());
+ EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
+ iterator.GetNextULeb128());
EXPECT_EQ(kOffset, iterator.GetNextULeb128());
}
@@ -261,7 +263,7 @@ TEST_F(EhFrameWriterTest, PcOffsetEncoding16bitDelta) {
}
TEST_F(EhFrameWriterTest, PcOffsetEncoding32bit) {
- static const int kOffset = kMaxUInt16 + 42;
+ static const uint32_t kOffset = kMaxUInt16 + 42;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -277,8 +279,8 @@ TEST_F(EhFrameWriterTest, PcOffsetEncoding32bit) {
}
TEST_F(EhFrameWriterTest, PcOffsetEncoding32bitDelta) {
- static const int kFirstOffset = kMaxUInt16 + 0x42;
- static const int kSecondOffset = kMaxUInt16 + 0x67;
+ static const uint32_t kFirstOffset = kMaxUInt16 + 0x42;
+ static const uint32_t kSecondOffset = kMaxUInt16 + 0x67;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -311,8 +313,9 @@ TEST_F(EhFrameWriterTest, SaveRegisterUnsignedOffset) {
iterator.SkipToFdeDirectives();
EXPECT_EQ((2 << 6) | kTestRegisterCode, iterator.GetNextByte());
- EXPECT_EQ(kOffset / EhFrameConstants::kDataAlignmentFactor,
- iterator.GetNextULeb128());
+ EXPECT_EQ(
+ static_cast<uint32_t>(kOffset / EhFrameConstants::kDataAlignmentFactor),
+ iterator.GetNextULeb128());
}
TEST_F(EhFrameWriterTest, SaveRegisterSignedOffset) {
@@ -332,7 +335,8 @@ TEST_F(EhFrameWriterTest, SaveRegisterSignedOffset) {
EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kOffsetExtendedSf,
iterator.GetNextOpcode());
- EXPECT_EQ(kTestRegisterCode, iterator.GetNextULeb128());
+ EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
+ iterator.GetNextULeb128());
EXPECT_EQ(kOffset / EhFrameConstants::kDataAlignmentFactor,
iterator.GetNextSLeb128());
}
@@ -350,7 +354,8 @@ TEST_F(EhFrameWriterTest, RegisterNotModified) {
EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kSameValue,
iterator.GetNextOpcode());
- EXPECT_EQ(kTestRegisterCode, iterator.GetNextULeb128());
+ EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
+ iterator.GetNextULeb128());
}
TEST_F(EhFrameWriterTest, RegisterFollowsInitialRule) {
« no previous file with comments | « test/unittests/eh-frame-iterator-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698