diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-11-27 19:43:57 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-11-27 19:43:57 +0000 |
commit | 551d3af1def552d615342f71b77c62dc794f4c14 (patch) | |
tree | c50f2385046a4eb759b08991e37e273328e3a48c | |
parent | d42db7e083ee0edda327782aa122ad6474c126d1 (diff) | |
download | bcm5719-llvm-551d3af1def552d615342f71b77c62dc794f4c14.tar.gz bcm5719-llvm-551d3af1def552d615342f71b77c62dc794f4c14.zip |
Fix -Werror build for signed/unsigned comparison with use of explicit unsigned literals
llvm-svn: 319081
-rw-r--r-- | llvm/unittests/Support/BinaryStreamTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/unittests/Support/BinaryStreamTest.cpp b/llvm/unittests/Support/BinaryStreamTest.cpp index 7aa033c76e2..ef0be1909e7 100644 --- a/llvm/unittests/Support/BinaryStreamTest.cpp +++ b/llvm/unittests/Support/BinaryStreamTest.cpp @@ -279,13 +279,13 @@ TEST_F(BinaryStreamTest, StreamRefDynamicSize) { // When the stream is empty, it should report a 0 length and we should get an // error trying to read even 1 byte from it. BinaryStreamRef ConstRef(Stream); - EXPECT_EQ(0, ConstRef.getLength()); + EXPECT_EQ(0U, ConstRef.getLength()); EXPECT_THAT_ERROR(Reader.readObject(Byte), Failed()); // But if we write to it, its size should increase and we should be able to // read not just a byte, but the string that was written. EXPECT_THAT_ERROR(Writer.writeCString(Strings[0]), Succeeded()); - EXPECT_EQ(2, ConstRef.getLength()); + EXPECT_EQ(2U, ConstRef.getLength()); EXPECT_THAT_ERROR(Reader.readObject(Byte), Succeeded()); Reader.setOffset(0); @@ -296,25 +296,25 @@ TEST_F(BinaryStreamTest, StreamRefDynamicSize) { // the // underlying stream grows. BinaryStreamRef Dropped = ConstRef.drop_front(1); - EXPECT_EQ(1, Dropped.getLength()); + EXPECT_EQ(1U, Dropped.getLength()); EXPECT_THAT_ERROR(Writer.writeCString(Strings[1]), Succeeded()); - EXPECT_EQ(4, ConstRef.getLength()); - EXPECT_EQ(3, Dropped.getLength()); + EXPECT_EQ(4U, ConstRef.getLength()); + EXPECT_EQ(3U, Dropped.getLength()); // If we drop zero bytes from the back, we should continue tracking the // length. Dropped = Dropped.drop_back(0); EXPECT_THAT_ERROR(Writer.writeCString(Strings[2]), Succeeded()); - EXPECT_EQ(6, ConstRef.getLength()); - EXPECT_EQ(5, Dropped.getLength()); + EXPECT_EQ(6U, ConstRef.getLength()); + EXPECT_EQ(5U, Dropped.getLength()); // If we drop non-zero bytes from the back, we should stop tracking the // length. Dropped = Dropped.drop_back(1); EXPECT_THAT_ERROR(Writer.writeCString(Strings[3]), Succeeded()); - EXPECT_EQ(8, ConstRef.getLength()); - EXPECT_EQ(4, Dropped.getLength()); + EXPECT_EQ(8U, ConstRef.getLength()); + EXPECT_EQ(4U, Dropped.getLength()); } TEST_F(BinaryStreamTest, DropOperations) { @@ -397,7 +397,7 @@ TEST_F(BinaryStreamTest, MutableBinaryByteStreamBounds) { TEST_F(BinaryStreamTest, AppendingStream) { AppendingBinaryByteStream Stream(llvm::support::little); - EXPECT_EQ(0, Stream.getLength()); + EXPECT_EQ(0U, Stream.getLength()); std::vector<uint8_t> InputData = {'T', 'e', 's', 't', 'T', 'e', 's', 't'}; auto Test = makeArrayRef(InputData).take_front(4); |