[gobject-introspection] Add test method for GDestroy with no user data
authorSimon Feltman <s.feltman@gmail.com>
Wed, 10 Oct 2012 23:20:50 +0000 (16:20 -0700)
committerSimon Feltman <s.feltman@gmail.com>
Fri, 12 Oct 2012 06:52:50 +0000 (23:52 -0700)
Added regress_test_callback_destroy_notify_no_user_data.
Updated Regress-1.0-expected.gir

https://bugzilla.gnome.org/show_bug.cgi?id=685922

tests/scanner/Regress-1.0-expected.gir
tests/scanner/regress.c
tests/scanner/regress.h

index a3e77db1ba312724e927e08519ad006c1bac20d5..8d123f7a07c963a44b435a9696bc9b8cfb220e0c 100644 (file)
@@ -2307,6 +2307,26 @@ is invoked.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="test_callback_destroy_notify_no_user_data"
+              c:identifier="regress_test_callback_destroy_notify_no_user_data">
+      <doc xml:whitespace="preserve">Adds a scope notified callback with no user data. This can invoke an error
+condition in bindings which needs to be tested.</doc>
+      <return-value transfer-ownership="none">
+        <type name="gint" c:type="int"/>
+      </return-value>
+      <parameters>
+        <parameter name="callback"
+                   transfer-ownership="none"
+                   scope="notified"
+                   destroy="1">
+          <type name="TestCallbackUserData"
+                c:type="RegressTestCallbackUserData"/>
+        </parameter>
+        <parameter name="notify" transfer-ownership="none" scope="async">
+          <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
+        </parameter>
+      </parameters>
+    </function>
     <function name="test_callback_thaw_async"
               c:identifier="regress_test_callback_thaw_async">
       <return-value transfer-ownership="none">
index 2fba9fd563b4ed1e80f69233bb1bf1045e09c1e3..c6ca6b74f05adb8736b097850069ad809fb90d55 100644 (file)
@@ -3323,6 +3323,20 @@ regress_test_callback_destroy_notify (RegressTestCallbackUserData callback,
   return retval;
 }
 
+/**
+ * regress_test_callback_destroy_notify_no_user_data:
+ * @callback: (scope notified):
+ *
+ * Adds a scope notified callback with no user data. This can invoke an error
+ * condition in bindings which needs to be tested.
+ **/
+int
+regress_test_callback_destroy_notify_no_user_data (RegressTestCallbackUserData callback,
+                              GDestroyNotify notify)
+{
+  return regress_test_callback_destroy_notify(callback, NULL, notify);
+}
+
 /**
  * regress_test_callback_thaw_notifications:
  *
index f2dae494c3c19926cf29134161492e8af7435080..635ea7bdb8058a60f809f08320d375405870d2af 100644 (file)
@@ -677,6 +677,8 @@ int regress_test_callback_user_data (RegressTestCallbackUserData callback,
 int regress_test_callback_destroy_notify (RegressTestCallbackUserData callback,
                                   gpointer user_data,
                                   GDestroyNotify notify);
+int regress_test_callback_destroy_notify_no_user_data (RegressTestCallbackUserData callback,
+                                  GDestroyNotify notify);
 int regress_test_callback_thaw_notifications (void);
 
 void regress_test_callback_async (RegressTestCallbackUserData callback, gpointer user_data);