Skip to content

Commit 266630c

Browse files
author
Walter Erquinigo
committed
[LLDB] Attempt to fix DumpDataExtractorTest
In 014c41d I tried to fix these tests, but it seems that I needed to change TEST for TEST_F to make that work. It's a pain that these failures don't repro on any of my machines, but I verified thta the initialization code for the tests is invoked.
1 parent 6b7c402 commit 266630c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lldb/unittests/Core/DumpDataExtractorTest.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void TestDumpWithAddress(uint64_t base_addr, size_t item_count,
4848
ASSERT_EQ(expected, result.GetString());
4949
}
5050

51-
TEST(DumpDataExtractorTest, BaseAddress) {
51+
TEST_F(DumpDataExtractorTest, BaseAddress) {
5252
TestDumpWithAddress(0x12341234, 1, "0x12341234: 0x11");
5353
TestDumpWithAddress(LLDB_INVALID_ADDRESS, 1, "0x11");
5454
TestDumpWithAddress(0x12341234, 2, "0x12341234: 0x11\n0x12341235: 0x22");
@@ -69,7 +69,7 @@ static void TestDumpWithOffset(offset_t start_offset,
6969
ASSERT_EQ(expected, result.GetString());
7070
}
7171

72-
TEST(DumpDataExtractorTest, StartOffset) {
72+
TEST_F(DumpDataExtractorTest, StartOffset) {
7373
TestDumpWithOffset(0, "0x00000000: 0x11 0x22 0x33");
7474
// The offset applies to the DataExtractor, not the address used when
7575
// formatting.
@@ -78,7 +78,7 @@ TEST(DumpDataExtractorTest, StartOffset) {
7878
TestDumpWithOffset(3, "");
7979
}
8080

81-
TEST(DumpDataExtractorTest, NullStream) {
81+
TEST_F(DumpDataExtractorTest, NullStream) {
8282
// We don't do any work if there is no output stream.
8383
uint8_t c = 0x11;
8484
StreamString result;
@@ -128,7 +128,7 @@ static void TestDump(const std::vector<T> data, lldb::Format format,
128128
LLDB_INVALID_ADDRESS, format, expected);
129129
}
130130

131-
TEST(DumpDataExtractorTest, Formats) {
131+
TEST_F(DumpDataExtractorTest, Formats) {
132132
TestDump<uint8_t>(1, lldb::eFormatDefault, "0x01");
133133
TestDump<uint8_t>(1, lldb::eFormatBoolean, "true");
134134
TestDump<uint8_t>(0xAA, lldb::eFormatBinary, "0b10101010");
@@ -274,7 +274,7 @@ TEST(DumpDataExtractorTest, Formats) {
274274
TestDump<int>(99, lldb::Format::eFormatVoid, "0x00000063");
275275
}
276276

277-
TEST(DumpDataExtractorTest, FormatCharArray) {
277+
TEST_F(DumpDataExtractorTest, FormatCharArray) {
278278
// Unlike the other formats, charArray isn't 1 array of N chars.
279279
// It must be passed as N chars of 1 byte each.
280280
// (eFormatVectorOfChar does this swap for you)
@@ -315,7 +315,7 @@ void TestDumpMultiLine(const T *data, size_t num_items, lldb::Format format,
315315
0x80000000, format, expected);
316316
}
317317

318-
TEST(DumpDataExtractorTest, MultiLine) {
318+
TEST_F(DumpDataExtractorTest, MultiLine) {
319319
// A vector counts as 1 item regardless of size.
320320
TestDumpMultiLine(std::vector<uint8_t>{0x11},
321321
lldb::Format::eFormatVectorOfUInt8, 1,
@@ -370,7 +370,7 @@ void TestDumpWithItemByteSize(size_t item_byte_size, lldb::Format format,
370370
expected);
371371
}
372372

373-
TEST(DumpDataExtractorTest, ItemByteSizeErrors) {
373+
TEST_F(DumpDataExtractorTest, ItemByteSizeErrors) {
374374
TestDumpWithItemByteSize(
375375
16, lldb::Format::eFormatBoolean,
376376
"error: unsupported byte size (16) for boolean format");

0 commit comments

Comments
 (0)