Skip to content

Commit 76e3a27

Browse files
committed
[lldb] Add test for CFMutableDictionaryRef
While writing a test for a change in Foundation I noticed we didn't yet test CFMutableDictionaryRef.
1 parent e10df77 commit 76e3a27

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_nscontainers_with_run_command(self):
2121

2222
def nscontainers_data_formatter_commands(self):
2323
self.expect(
24-
'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary cfarray_ref mutable_array_ref',
24+
'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary newMutableDictionaryRef cfarray_ref mutable_array_ref',
2525
substrs=[
2626
'(NSArray *) newArray = ',
2727
' @"50 elements"',
@@ -35,6 +35,8 @@ def nscontainers_data_formatter_commands(self):
3535
' 2 key/value pairs',
3636
'(NSDictionary *) newMutableDictionary = ',
3737
' 21 key/value pairs',
38+
'(CFMutableDictionaryRef) newMutableDictionaryRef = ',
39+
' 21 key/value pairs',
3840
'(CFArrayRef) cfarray_ref = ',
3941
' @"3 elements"',
4042
'(CFMutableArrayRef) mutable_array_ref = ',

lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ int main(int argc, const char *argv[]) {
476476
[newMutableDictionary setObject:@"foo" forKey:@"bar19"];
477477
[newMutableDictionary setObject:@"foo" forKey:@"bar20"];
478478

479+
CFMutableDictionaryRef newMutableDictionaryRef = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, newMutableDictionary);
480+
479481
id cfKeys[4] = {@"foo", @"bar", @"baz", @"quux"};
480482
id cfValues[4] = {@"foo", @"bar", @"baz", @"quux"};
481483
NSDictionary *nsDictionary = CFBridgingRelease(

0 commit comments

Comments
 (0)