[Lldb-commits] [lldb] 51e7257 - [lldb] Fix nondeterminism in DWARFIndexCachingTest
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue May 3 01:30:21 PDT 2022
Author: Pavel Labath
Date: 2022-05-03T10:28:47+02:00
New Revision: 51e72570d7e163d03ff211b7127899a1efd08174
URL: https://github.com/llvm/llvm-project/commit/51e72570d7e163d03ff211b7127899a1efd08174
DIFF: https://github.com/llvm/llvm-project/commit/51e72570d7e163d03ff211b7127899a1efd08174.diff
LOG: [lldb] Fix nondeterminism in DWARFIndexCachingTest
The entries in the input map need to be sorted as well, as there's no
guarantee that the entries (ConstStrings) will be inserted in the proper
order.
Added:
Modified:
lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp
Removed:
################################################################################
diff --git a/lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp b/lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp
index 0fb7f46068be7..361e529e71645 100644
--- a/lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp
@@ -67,7 +67,7 @@ static void EncodeDecode(const NameToDIE &object, ByteOrder byte_order) {
NameToDIE decoded_object;
offset_t data_offset = 0;
decoded_object.Decode(data, &data_offset, strtab_reader);
- EXPECT_TRUE(object == decoded_object);
+ EXPECT_EQ(object, decoded_object);
}
static void EncodeDecode(const NameToDIE &object) {
@@ -83,6 +83,7 @@ TEST(DWARFIndexCachingTest, NameToDIEEncodeDecode) {
DIERef(llvm::None, DIERef::Section::DebugInfo, 0x11223344));
map.Insert(ConstString("workd"),
DIERef(100, DIERef::Section::DebugInfo, 0x11223344));
+ map.Finalize();
// Make sure a valid NameToDIE map encodes and decodes correctly.
EncodeDecode(map);
}
More information about the lldb-commits
mailing list