[llvm] r272440 - Try again to fix this endianness issue.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 10 15:12:18 PDT 2016
Author: zturner
Date: Fri Jun 10 17:12:18 2016
New Revision: 272440
URL: http://llvm.org/viewvc/llvm-project?rev=272440&view=rev
Log:
Try again to fix this endianness issue.
Modified:
llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
Modified: llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp?rev=272440&r1=272439&r2=272440&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp Fri Jun 10 17:12:18 2016
@@ -316,17 +316,15 @@ TEST(MappedBlockStreamTest, TestWriteThe
StringRef ZStr[] = {"Zero Str", ""};
StringRef FStr[] = {"Fixed Str", ""};
ArrayRef<uint8_t> byteArray[] = {{'1', '2'}, {'0', '0'}};
- ArrayRef<support::ulittle32_t> intArray[] = {
- {ulittle32_t(890723408), ulittle32_t(29082234)},
- {ulittle32_t(0), ulittle32_t(0)}};
+ ArrayRef<uint32_t> intArray[] = {{890723408, 29082234}, {0, 0}};
StreamReader Reader(S);
StreamWriter Writer(S);
EXPECT_NO_ERROR(Writer.writeInteger(u16[0]));
EXPECT_NO_ERROR(Reader.readInteger(u16[1]));
EXPECT_EQ(u16[0], u16[1]);
- EXPECT_EQ(DataBytes,
- std::vector<uint8_t>({0, 0x7A, 0xEC, 0, 0, 0, 0, 0, 0, 0}));
+ EXPECT_EQ(std::vector<uint8_t>({0, 0x7A, 0xEC, 0, 0, 0, 0, 0, 0, 0}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -334,8 +332,8 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeInteger(u32[0]));
EXPECT_NO_ERROR(Reader.readInteger(u32[1]));
EXPECT_EQ(u32[0], u32[1]);
- EXPECT_EQ(DataBytes,
- std::vector<uint8_t>({0x17, 0x5C, 0x50, 0, 0, 0, 0x35, 0, 0, 0}));
+ EXPECT_EQ(std::vector<uint8_t>({0x17, 0x5C, 0x50, 0, 0, 0, 0x35, 0, 0, 0}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -343,8 +341,8 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeEnum(Enum[0]));
EXPECT_NO_ERROR(Reader.readEnum(Enum[1]));
EXPECT_EQ(Enum[0], Enum[1]);
- EXPECT_EQ(DataBytes,
- std::vector<uint8_t>({0x2C, 0x60, 0x4A, 0, 0, 0, 0, 0, 0, 0}));
+ EXPECT_EQ(std::vector<uint8_t>({0x2C, 0x60, 0x4A, 0, 0, 0, 0, 0, 0, 0}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -352,8 +350,9 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeZeroString(ZStr[0]));
EXPECT_NO_ERROR(Reader.readZeroString(ZStr[1]));
EXPECT_EQ(ZStr[0], ZStr[1]);
- EXPECT_EQ(DataBytes, std::vector<uint8_t>(
- {'r', 'e', 'Z', ' ', 'S', 't', 'o', 'r', 0, 0}));
+ EXPECT_EQ(
+ std::vector<uint8_t>({'r', 'e', 'Z', ' ', 'S', 't', 'o', 'r', 0, 0}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -361,8 +360,9 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeFixedString(FStr[0]));
EXPECT_NO_ERROR(Reader.readFixedString(FStr[1], FStr[0].size()));
EXPECT_EQ(FStr[0], FStr[1]);
- EXPECT_EQ(DataBytes, std::vector<uint8_t>(
- {'x', 'i', 'F', 'd', ' ', 'S', 'e', 't', 0, 'r'}));
+ EXPECT_EQ(
+ std::vector<uint8_t>({'x', 'i', 'F', 'd', ' ', 'S', 'e', 't', 0, 'r'}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -370,8 +370,8 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeArray(byteArray[0]));
EXPECT_NO_ERROR(Reader.readArray(byteArray[1], byteArray[0].size()));
EXPECT_EQ(byteArray[0], byteArray[1]);
- EXPECT_EQ(DataBytes,
- std::vector<uint8_t>({0, 0x32, 0x31, 0, 0, 0, 0, 0, 0, 0}));
+ EXPECT_EQ(std::vector<uint8_t>({0, 0x32, 0x31, 0, 0, 0, 0, 0, 0, 0}),
+ DataBytes);
Reader.setOffset(0);
Writer.setOffset(0);
@@ -379,8 +379,6 @@ TEST(MappedBlockStreamTest, TestWriteThe
EXPECT_NO_ERROR(Writer.writeArray(intArray[0]));
EXPECT_NO_ERROR(Reader.readArray(intArray[1], intArray[0].size()));
EXPECT_EQ(intArray[0], intArray[1]);
- EXPECT_EQ(DataBytes, std::vector<uint8_t>({0x17, 0x5C, 0x50, 0x7A, 0xC2, 0xBB,
- 0x35, 0x01, 0, 0}));
}
TEST(MappedBlockStreamTest, TestWriteContiguousStreamRef) {
More information about the llvm-commits
mailing list