Author: Walter Erquinigo Date: 2023-09-18T22:02:05Z New Revision: 266630cffceefbe3b00f34ba8efcfba62259335e
URL: https://github.com/llvm/llvm-project/commit/266630cffceefbe3b00f34ba8efcfba62259335e DIFF: https://github.com/llvm/llvm-project/commit/266630cffceefbe3b00f34ba8efcfba62259335e.diff LOG: [LLDB] Attempt to fix DumpDataExtractorTest In 014c41d688f961cdb81cf92e6ba97100a49766a6 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. Added: Modified: lldb/unittests/Core/DumpDataExtractorTest.cpp Removed: ################################################################################ diff --git a/lldb/unittests/Core/DumpDataExtractorTest.cpp b/lldb/unittests/Core/DumpDataExtractorTest.cpp index 3332cf6f07fd180..8c58fecfee29cbe 100644 --- a/lldb/unittests/Core/DumpDataExtractorTest.cpp +++ b/lldb/unittests/Core/DumpDataExtractorTest.cpp @@ -48,7 +48,7 @@ static void TestDumpWithAddress(uint64_t base_addr, size_t item_count, ASSERT_EQ(expected, result.GetString()); } -TEST(DumpDataExtractorTest, BaseAddress) { +TEST_F(DumpDataExtractorTest, BaseAddress) { TestDumpWithAddress(0x12341234, 1, "0x12341234: 0x11"); TestDumpWithAddress(LLDB_INVALID_ADDRESS, 1, "0x11"); TestDumpWithAddress(0x12341234, 2, "0x12341234: 0x11\n0x12341235: 0x22"); @@ -69,7 +69,7 @@ static void TestDumpWithOffset(offset_t start_offset, ASSERT_EQ(expected, result.GetString()); } -TEST(DumpDataExtractorTest, StartOffset) { +TEST_F(DumpDataExtractorTest, StartOffset) { TestDumpWithOffset(0, "0x00000000: 0x11 0x22 0x33"); // The offset applies to the DataExtractor, not the address used when // formatting. @@ -78,7 +78,7 @@ TEST(DumpDataExtractorTest, StartOffset) { TestDumpWithOffset(3, ""); } -TEST(DumpDataExtractorTest, NullStream) { +TEST_F(DumpDataExtractorTest, NullStream) { // We don't do any work if there is no output stream. uint8_t c = 0x11; StreamString result; @@ -128,7 +128,7 @@ static void TestDump(const std::vector<T> data, lldb::Format format, LLDB_INVALID_ADDRESS, format, expected); } -TEST(DumpDataExtractorTest, Formats) { +TEST_F(DumpDataExtractorTest, Formats) { TestDump<uint8_t>(1, lldb::eFormatDefault, "0x01"); TestDump<uint8_t>(1, lldb::eFormatBoolean, "true"); TestDump<uint8_t>(0xAA, lldb::eFormatBinary, "0b10101010"); @@ -274,7 +274,7 @@ TEST(DumpDataExtractorTest, Formats) { TestDump<int>(99, lldb::Format::eFormatVoid, "0x00000063"); } -TEST(DumpDataExtractorTest, FormatCharArray) { +TEST_F(DumpDataExtractorTest, FormatCharArray) { // Unlike the other formats, charArray isn't 1 array of N chars. // It must be passed as N chars of 1 byte each. // (eFormatVectorOfChar does this swap for you) @@ -315,7 +315,7 @@ void TestDumpMultiLine(const T *data, size_t num_items, lldb::Format format, 0x80000000, format, expected); } -TEST(DumpDataExtractorTest, MultiLine) { +TEST_F(DumpDataExtractorTest, MultiLine) { // A vector counts as 1 item regardless of size. TestDumpMultiLine(std::vector<uint8_t>{0x11}, lldb::Format::eFormatVectorOfUInt8, 1, @@ -370,7 +370,7 @@ void TestDumpWithItemByteSize(size_t item_byte_size, lldb::Format format, expected); } -TEST(DumpDataExtractorTest, ItemByteSizeErrors) { +TEST_F(DumpDataExtractorTest, ItemByteSizeErrors) { TestDumpWithItemByteSize( 16, lldb::Format::eFormatBoolean, "error: unsupported byte size (16) for boolean format"); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits