[Lldb-commits] [lldb] f3d43ec - [lldb][Windows] Fixup overlapping memory regions tests

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 7 08:36:19 PDT 2022


Author: David Spickett
Date: 2022-07-07T15:36:14Z
New Revision: f3d43eca34d4e3ddff2ba8a020ca21a9e963dd4f

URL: https://github.com/llvm/llvm-project/commit/f3d43eca34d4e3ddff2ba8a020ca21a9e963dd4f
DIFF: https://github.com/llvm/llvm-project/commit/f3d43eca34d4e3ddff2ba8a020ca21a9e963dd4f.diff

LOG: [lldb][Windows] Fixup overlapping memory regions tests

As suggested in post-commit review on https://reviews.llvm.org/D129272.

* Rename the test case.
* Simplify the overlap check.
* Correct assertion.

Added: 
    

Modified: 
    lldb/test/API/functionalities/memory-region/TestMemoryRegion.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py b/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
index 18118377a8b8..3ea4a75ec9b9 100644
--- a/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
+++ b/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
@@ -88,7 +88,7 @@ def test_command(self):
         self.assertTrue(result.Succeeded())
         self.assertEqual(result.GetOutput(), all_regions)
 
-    def test_unique_base_addresses(self):
+    def test_no_overlapping_regions(self):
         # In the past on Windows we were recording AllocationBase as the base address
         # of the current region, not BaseAddress. So if a range of pages was split
         # into regions you would see several regions with the same base address.
@@ -114,10 +114,9 @@ def test_unique_base_addresses(self):
                 region_base = region.GetRegionBase()
                 region_end = region.GetRegionEnd()
 
-                if (region_base >= previous_base and region_base < previous_end) \
-                    or (region_end > previous_base and region_end <= previous_end):
-                    self.assertFalse(base_address in base_addresses,
-                        "Unexpected overlapping memory region found.")
+                self.assertFalse(
+                    (region_base < previous_end) and (previous_base < region_end),
+                    "Unexpected overlapping memory region found.")
 
                 previous_base = region_base
                 previous_end = region_end
\ No newline at end of file


        


More information about the lldb-commits mailing list