From 76e3a27c16d2a8171454cf12a33e35e3ae6f9dc2 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 11 Sep 2020 14:33:55 -0700 Subject: [PATCH] [lldb] Add test for CFMutableDictionaryRef While writing a test for a change in Foundation I noticed we didn't yet test CFMutableDictionaryRef. --- .../data-formatter-objc/TestDataFormatterObjCNSContainer.py | 4 +++- .../functionalities/data-formatter/data-formatter-objc/main.m | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py index d13d5d5df1d5..05367c144b30 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py @@ -21,7 +21,7 @@ class ObjCDataFormatterNSContainer(ObjCDataFormatterTestCase): def nscontainers_data_formatter_commands(self): self.expect( - 'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary cfarray_ref mutable_array_ref', + 'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary newMutableDictionaryRef cfarray_ref mutable_array_ref', substrs=[ '(NSArray *) newArray = ', ' @"50 elements"', @@ -35,6 +35,8 @@ class ObjCDataFormatterNSContainer(ObjCDataFormatterTestCase): ' 2 key/value pairs', '(NSDictionary *) newMutableDictionary = ', ' 21 key/value pairs', + '(CFMutableDictionaryRef) newMutableDictionaryRef = ', + ' 21 key/value pairs', '(CFArrayRef) cfarray_ref = ', ' @"3 elements"', '(CFMutableArrayRef) mutable_array_ref = ', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m index 169b3aed4f22..409cb0a993f9 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m @@ -476,6 +476,8 @@ int main(int argc, const char *argv[]) { [newMutableDictionary setObject:@"foo" forKey:@"bar19"]; [newMutableDictionary setObject:@"foo" forKey:@"bar20"]; + CFMutableDictionaryRef newMutableDictionaryRef = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, newMutableDictionary); + id cfKeys[4] = {@"foo", @"bar", @"baz", @"quux"}; id cfValues[4] = {@"foo", @"bar", @"baz", @"quux"}; NSDictionary *nsDictionary = CFBridgingRelease(