================ @@ -154,14 +154,32 @@ def test_find_in_memory_unaligned(self): self.assertEqual(addr, lldb.LLDB_INVALID_ADDRESS) def test_memory_info_list_iterable(self): - """Make sure the SBMemoryRegionInfoList is iterable""" + """Make sure the SBMemoryRegionInfoList is iterable and each yielded object is unique""" self.assertTrue(self.process, PROCESS_IS_VALID) self.assertState(self.process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) info_list = self.process.GetMemoryRegions() self.assertTrue(info_list.GetSize() > 0) + + collected_info = [] try: - for info in info_list: - pass + for region in info_list: + collected_info.append(region) except Exception: self.fail("SBMemoryRegionInfoList is not iterable") + + self.assertTrue(len(collected_info) >= 2, "Need at least 2 items") ---------------- Jlalond wrote:
Why 2? We know the number of emmeory regions from `info_list`, compare to the underlying collection https://github.com/llvm/llvm-project/pull/144815 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits