mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
[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.
This commit is contained in:
parent
6b7c402774
commit
266630cffc
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user