Commits

Ronald Oussoren committed 76649db

bridgesupport test: finish testing class metadata

Comments (0)

Files changed (2)

pyobjc-core/Lib/objc/_bridgesupport.py

 
         s = self.attribute_string(node, "sel_of_type", "sel_of_type64")
         if s:
-            s = self.typestr2typestr(s)
-            result["sel_of_type"] = s
+            result["sel_of_type"] = self.typestr2typestr(s)
 
         s = self.attribute_string(node, "c_array_of_fixed_length", None)
         if s:
                     metadata['c_array_delimited_by_null'] = c_array
 
                 if c_length:
-                    metadata['c_array_length_in_arg'] = int(c_length);
+                    metadata['c_array_length_in_arg'] = int(c_length) + 2;
 
             arguments = metadata['arguments'] = {}
 

pyobjc-core/PyObjCTest/test_bridgesupport.py

        <retval function_pointer_retained='true'/><!-- ignored, no function data -->
     </method>
     <method selector='method21'>
-       <retval function_pointer_retained='true' function_pointer='true'>
+       <retval function_pointer_retained='false' function_pointer='true'>
           <retval type='v' />
           <arg type='@' />
           <arg type='d' />
        </retval>
     </method>
     <method selector='method22'>
-       <retval function_pointer_retained='true' block='true'>
+       <retval function_pointer_retained='false' block='true'>
           <retval type='v' />
           <arg type='@' />
           <arg type='d' />
        <arg index='1' function_pointer_retained='true'/><!-- ignored, no function data -->
     </method>
     <method selector='method21'>
-       <arg index='1' function_pointer_retained='true' function_pointer='true'>
+       <arg index='1' function_pointer_retained='false' function_pointer='true'>
           <retval type='v' />
           <arg type='@' />
           <arg type='d' />
        </arg>
     </method>
     <method selector='method22'>
-       <arg index='1' function_pointer_retained='true' block='true'>
+       <arg index='1' function_pointer_retained='false' block='true'>
           <retval type='v' />
           <arg type='@' />
           <arg type='d' />
           <arg type='d' />
        </arg>
     </method>
-    <method selector='method24'>
-       <arg index='1' block='true' classmethod='true'>
+    <method selector='method24' classmethod='true'>
+       <arg index='1' block='true'>
           <retval type='v' />
           <arg type='@' />
           <arg type='d' />
             (b'MyClass2', b'method6', False): { 'retval': { 'type': b'd' } },
             (b'MyClass2', b'method7', False): { 'suggestion': "don't use this method" },
             (b'MyClass2', b'method8', False): { 'suggestion': 'ignore me' },
-            (b'MyClass2', b'method9', False): { 'suggestion': 'ignore me' },
+            (b'MyClass2', b'method9', False): { 'retval': { 'type': b'd' } },
             (b'MyClass2', b'method10', False ): { 'retval': { 'type': b'd' } },
             (b'MyClass2', b'method11', False ): {
                 'retval': { 
                 'retval': { 'c_array_length_in_arg': (4+2, 5+2) }
             },
             (b'MyClass2', b'method21', False): {
-                'retval': { 'function_pointer_retained': True, 'callable': {
-                    'retval': { 'type': b'v' },
-                    'arguments': { 
-                        0: b'@',
-                        1: b'd',
-                    }
-                }}
-            },
-            (b'MyClass2', b'method22', False): {
-                'retval': { 'function_pointer_retained': True, 'callable': {
+                'retval': { 'callable_retained': False, 'callable': {
                     'retval': { 'type': b'v' },
                     'arguments': { 
                         0: { 'type': b'@' },
                     }
                 }}
             },
+            (b'MyClass2', b'method22', False): {
+                'retval': { 'callable_retained': False, 'callable': {
+                    'retval': { 'type': b'v' },
+                    'arguments': { 
+                        0: { 'type': b'^v' },
+                        1: { 'type': b'@' },
+                        2: { 'type': b'd' },
+                    }
+                }}
+            },
             (b'MyClass2', b'method23', False): {
-                'retval': { 'callable': {
+                'retval': { 'callable_retained': True, 'callable': {
                     'retval': { 'type': b'v' },
                     'arguments': {
                         0: { 'type': b'@' },
                 }}
             },
             (b'MyClass2', b'method24', False): {
-                'retval': { 'callable': {
+                'retval': { 'callable_retained': True, 'callable': {
                     'retval': { 'type': b'v' },
                     'arguments': {
-                        0: { 'type': b'@' },
-                        1: { 'type': b'd' },
+                        0: { 'type': b'^v' },
+                        1: { 'type': b'@' },
+                        2: { 'type': b'd' },
                     }
                 }}
             },
             },
             (b'MyClass3', b'method13b', False): {
                 'arguments': {
-                    2+1: { 'sel_of_type': b'v@:f', 'c_array_of_fixed_lengt': 4 }
+                    2+1: { 'sel_of_type': b'v@:f', 'c_array_of_fixed_length': 4 }
                 }
             },
             (b'MyClass3', b'method14', False): {
             },
             (b'MyClass3', b'method21', False): {
                 'arguments': {
-                    2+1: { 'callable_retained': True, 'callable': {
+                    2+1: { 'callable_retained': False, 'callable': {
                         'retval': { 'type': b'v' },
                         'arguments': {
                             0:  { 'type': b'@' },
             },
             (b'MyClass3', b'method22', False): {
                 'arguments': {
+                    2+1: { 'callable_retained': False, 'callable': {
+                        'retval': { 'type': b'v' },
+                        'arguments': {
+                            0:  { 'type': b'^v' },
+                            1:  { 'type': b'@' },
+                            2:  { 'type': b'd' },
+                        }
+                    }}
+                }
+            },
+            (b'MyClass3', b'method23', False): {
+                'arguments': {
                     2+1: { 'callable_retained': True, 'callable': {
                         'retval': { 'type': b'v' },
                         'arguments': {
                     }}
                 }
             },
-            (b'MyClass3', b'method23', False): {
+            (b'MyClass3', b'method24', True): {
                 'arguments': {
-                    2+1: { 'callable': {
+                    2+1: { 'callable_retained': True, 'callable': {
                         'retval': { 'type': b'v' },
                         'arguments': {
-                            0:  { 'type': b'@' },
-                            1:  { 'type': b'd' },
-                        }
-                    }}
-                }
-            },
-            (b'MyClass3', b'method23', False): {
-                'arguments': {
-                    2+1: { 'callable': {
-                        'retval': { 'type': b'v' },
-                        'arguments': {
-                            0:  { 'type': b'@' },
-                            1:  { 'type': b'd' },
+                            0:  { 'type': b'^v' },
+                            1:  { 'type': b'@' },
+                            2:  { 'type': b'd' },
                         }
                     }}
                 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.