amccarth updated this revision to Diff 135272.
amccarth added a comment.

Per Pavel's suggestion, change special value to mean don't check the number of 
locations found.


https://reviews.llvm.org/D43419

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
  lldb/packages/Python/lldbsuite/test/lldbutil.py


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -343,7 +343,8 @@
 
     If extra_options is not None, then we append it to the breakpoint set 
command.
 
-    If num_expected_locations is -1 we check that we got AT LEAST one 
location, otherwise we check that num_expected_locations equals the number of 
locations.
+    If num_expected_locations is -1, we check that we got AT LEAST one 
location. If num_expected_locations is -2, we don't
+    check the actual number at all. Otherwise, we check that 
num_expected_locations equals the number of locations.
 
     If loc_exact is true, we check that there is one location, and that 
location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
     if num_locations == -1:
         test.assertTrue(out_num_locations > 0,
                         "Expecting one or more locations, got none.")
-    else:
+    elif num_locations != -2:
         test.assertTrue(
             num_locations == out_num_locations,
             "Expecting %d locations, got %d." %
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===================================================================
--- 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
         bp_main = lldbutil.run_break_set_by_file_and_line(
             self, 'main.cpp', self.line_main)
+
         bp_foo = lldbutil.run_break_set_by_file_and_line(
-            self, 'foo.cpp', self.line_foo)
+            self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
         process = target.LaunchSimple(
             None, env, self.get_process_working_directory())


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -343,7 +343,8 @@
 
     If extra_options is not None, then we append it to the breakpoint set command.
 
-    If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
+    If num_expected_locations is -1, we check that we got AT LEAST one location. If num_expected_locations is -2, we don't
+    check the actual number at all. Otherwise, we check that num_expected_locations equals the number of locations.
 
     If loc_exact is true, we check that there is one location, and that location must be at the input file and line number."""
 
@@ -563,7 +564,7 @@
     if num_locations == -1:
         test.assertTrue(out_num_locations > 0,
                         "Expecting one or more locations, got none.")
-    else:
+    elif num_locations != -2:
         test.assertTrue(
             num_locations == out_num_locations,
             "Expecting %d locations, got %d." %
Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -29,8 +29,9 @@
 
         bp_main = lldbutil.run_break_set_by_file_and_line(
             self, 'main.cpp', self.line_main)
+
         bp_foo = lldbutil.run_break_set_by_file_and_line(
-            self, 'foo.cpp', self.line_foo)
+            self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
 
         process = target.LaunchSimple(
             None, env, self.get_process_working_directory())
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to