[Lldb-commits] [lldb] 76e3a27 - [lldb] Add test for CFMutableDictionaryRef

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 11 16:11:32 PDT 2020


Author: Jonas Devlieghere
Date: 2020-09-11T16:11:25-07:00
New Revision: 76e3a27c16d2a8171454cf12a33e35e3ae6f9dc2

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

LOG: [lldb] Add test for CFMutableDictionaryRef

While writing a test for a change in Foundation I noticed we didn't yet
test CFMutableDictionaryRef.

Added: 
    

Modified: 
    lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
    lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m

Removed: 
    


################################################################################
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 @@ def test_nscontainers_with_run_command(self):
 
     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 @@ def nscontainers_data_formatter_commands(self):
                 ' 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(


        


More information about the lldb-commits mailing list