diff options
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-objc')
-rw-r--r-- | lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py | 34 | ||||
-rw-r--r-- | lldb/test/functionalities/data-formatter/data-formatter-objc/main.m | 4 |
2 files changed, 10 insertions, 28 deletions
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py index 95022b497f1..ab629105062 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -8,6 +8,7 @@ import unittest2 import lldb from lldbtest import * import datetime +import lldbutil class ObjCDataFormatterTestCase(TestBase): @@ -111,10 +112,7 @@ class ObjCDataFormatterTestCase(TestBase): """Check that Unicode characters come out of CFString summary correctly.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -145,10 +143,7 @@ class ObjCDataFormatterTestCase(TestBase): """Test basic ObjC formatting behavior.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -202,10 +197,7 @@ class ObjCDataFormatterTestCase(TestBase): """Test formatters for AppKit classes.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -374,10 +366,7 @@ class ObjCDataFormatterTestCase(TestBase): """Test common cases of expression parser <--> formatters interaction.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -420,10 +409,7 @@ class ObjCDataFormatterTestCase(TestBase): """Test formatters for Core OSX frameworks.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -477,10 +463,7 @@ class ObjCDataFormatterTestCase(TestBase): """Test the behavior of formatters when KVO is in use.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.expect("breakpoint set -f main.m -l %d" % self.line, - BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" % - self.line) + lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -514,7 +497,8 @@ class ObjCDataFormatterTestCase(TestBase): # check that NSMutableDictionary's formatter is not confused when dealing with a KVO'd dictionary self.expect('frame variable newMutableDictionary', substrs = ['(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs']) - self.runCmd("breakpoint set -r setAtoms") + lldbutil.run_break_set_by_regexp (self, 'setAtoms') + self.runCmd("continue") self.expect("frame variable _cmd",substrs = ['setAtoms:']) diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/main.m b/lldb/test/functionalities/data-formatter/data-formatter-objc/main.m index eaf372b6103..aae6479da5f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/main.m +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/main.m @@ -653,9 +653,7 @@ int main (int argc, const char * argv[]) NSArray *components = @[@"usr", @"blah", @"stuff"]; NSString *path = [NSString pathWithComponents: components]; - // Set break point at this line. - - [molecule addObserver:[My_KVO_Observer new] forKeyPath:@"atoms" options:0 context:NULL]; + [molecule addObserver:[My_KVO_Observer new] forKeyPath:@"atoms" options:0 context:NULL]; // Set break point at this line. [newMutableDictionary addObserver:[My_KVO_Observer new] forKeyPath:@"weirdKeyToKVO" options:NSKeyValueObservingOptionNew context:NULL]; [molecule setAtoms:nil]; |