Skip to content

Commit 551d3af

Browse files
committed
Fix -Werror build for signed/unsigned comparison with use of explicit unsigned literals
llvm-svn: 319081
1 parent d42db7e commit 551d3af

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/unittests/Support/BinaryStreamTest.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ TEST_F(BinaryStreamTest, StreamRefDynamicSize) {
279279
// When the stream is empty, it should report a 0 length and we should get an
280280
// error trying to read even 1 byte from it.
281281
BinaryStreamRef ConstRef(Stream);
282-
EXPECT_EQ(0, ConstRef.getLength());
282+
EXPECT_EQ(0U, ConstRef.getLength());
283283
EXPECT_THAT_ERROR(Reader.readObject(Byte), Failed());
284284

285285
// But if we write to it, its size should increase and we should be able to
286286
// read not just a byte, but the string that was written.
287287
EXPECT_THAT_ERROR(Writer.writeCString(Strings[0]), Succeeded());
288-
EXPECT_EQ(2, ConstRef.getLength());
288+
EXPECT_EQ(2U, ConstRef.getLength());
289289
EXPECT_THAT_ERROR(Reader.readObject(Byte), Succeeded());
290290

291291
Reader.setOffset(0);
@@ -296,25 +296,25 @@ TEST_F(BinaryStreamTest, StreamRefDynamicSize) {
296296
// the
297297
// underlying stream grows.
298298
BinaryStreamRef Dropped = ConstRef.drop_front(1);
299-
EXPECT_EQ(1, Dropped.getLength());
299+
EXPECT_EQ(1U, Dropped.getLength());
300300

301301
EXPECT_THAT_ERROR(Writer.writeCString(Strings[1]), Succeeded());
302-
EXPECT_EQ(4, ConstRef.getLength());
303-
EXPECT_EQ(3, Dropped.getLength());
302+
EXPECT_EQ(4U, ConstRef.getLength());
303+
EXPECT_EQ(3U, Dropped.getLength());
304304

305305
// If we drop zero bytes from the back, we should continue tracking the
306306
// length.
307307
Dropped = Dropped.drop_back(0);
308308
EXPECT_THAT_ERROR(Writer.writeCString(Strings[2]), Succeeded());
309-
EXPECT_EQ(6, ConstRef.getLength());
310-
EXPECT_EQ(5, Dropped.getLength());
309+
EXPECT_EQ(6U, ConstRef.getLength());
310+
EXPECT_EQ(5U, Dropped.getLength());
311311

312312
// If we drop non-zero bytes from the back, we should stop tracking the
313313
// length.
314314
Dropped = Dropped.drop_back(1);
315315
EXPECT_THAT_ERROR(Writer.writeCString(Strings[3]), Succeeded());
316-
EXPECT_EQ(8, ConstRef.getLength());
317-
EXPECT_EQ(4, Dropped.getLength());
316+
EXPECT_EQ(8U, ConstRef.getLength());
317+
EXPECT_EQ(4U, Dropped.getLength());
318318
}
319319

320320
TEST_F(BinaryStreamTest, DropOperations) {
@@ -397,7 +397,7 @@ TEST_F(BinaryStreamTest, MutableBinaryByteStreamBounds) {
397397

398398
TEST_F(BinaryStreamTest, AppendingStream) {
399399
AppendingBinaryByteStream Stream(llvm::support::little);
400-
EXPECT_EQ(0, Stream.getLength());
400+
EXPECT_EQ(0U, Stream.getLength());
401401

402402
std::vector<uint8_t> InputData = {'T', 'e', 's', 't', 'T', 'e', 's', 't'};
403403
auto Test = makeArrayRef(InputData).take_front(4);

0 commit comments

Comments
 (0)