[gobject-introspection] Move recently added (skip) tests to the regress module



commit 7bcc7ee5e57ea9d722868fa4340217ab7584cde0
Author: David Zeuthen <davidz redhat com>
Date:   Fri May 13 18:24:50 2011 -0400

    Move recently added (skip) tests to the regress module
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 tests/scanner/Foo-1.0-expected.gir     |   52 --------------------------------
 tests/scanner/Regress-1.0-expected.gir |   52 ++++++++++++++++++++++++++++++++
 tests/scanner/foo.c                    |   43 --------------------------
 tests/scanner/foo.h                    |   12 -------
 tests/scanner/regress.c                |   49 ++++++++++++++++++++++++++++++
 tests/scanner/regress.h                |   12 +++++++
 6 files changed, 113 insertions(+), 107 deletions(-)
---
diff --git a/tests/scanner/Foo-1.0-expected.gir b/tests/scanner/Foo-1.0-expected.gir
index 64f40db..fa5ee93 100644
--- a/tests/scanner/Foo-1.0-expected.gir
+++ b/tests/scanner/Foo-1.0-expected.gir
@@ -455,58 +455,6 @@ uses a C sugar return type.</doc>
           </parameter>
         </parameters>
       </method>
-      <method name="skip_param"
-              c:identifier="foo_object_skip_param"
-              throws="1">
-        <doc xml:whitespace="preserve">Check that the return value is skipped</doc>
-        <return-value transfer-ownership="none">
-          <doc xml:whitespace="preserve">%TRUE if the call succeeds, %FALSE if @error is set.</doc>
-          <type name="gboolean" c:type="gboolean"/>
-        </return-value>
-        <parameters>
-          <parameter name="a" transfer-ownership="none">
-            <doc xml:whitespace="preserve">Parameter.</doc>
-            <type name="gint" c:type="gint"/>
-          </parameter>
-          <parameter name="out_b"
-                     direction="out"
-                     caller-allocates="0"
-                     transfer-ownership="full">
-            <doc xml:whitespace="preserve">Return value.</doc>
-            <type name="gint" c:type="gint*"/>
-          </parameter>
-          <parameter name="c" transfer-ownership="none" skip="1">
-            <doc xml:whitespace="preserve">Other parameter.</doc>
-            <type name="gdouble" c:type="gdouble"/>
-          </parameter>
-        </parameters>
-      </method>
-      <method name="skip_return_val"
-              c:identifier="foo_object_skip_return_val"
-              throws="1">
-        <doc xml:whitespace="preserve">Check that the return value is skipped</doc>
-        <return-value transfer-ownership="none" skip="1">
-          <doc xml:whitespace="preserve">%TRUE if the call succeeds, %FALSE if @error is set.</doc>
-          <type name="gboolean" c:type="gboolean"/>
-        </return-value>
-        <parameters>
-          <parameter name="a" transfer-ownership="none">
-            <doc xml:whitespace="preserve">Parameter.</doc>
-            <type name="gint" c:type="gint"/>
-          </parameter>
-          <parameter name="out_b"
-                     direction="out"
-                     caller-allocates="0"
-                     transfer-ownership="full">
-            <doc xml:whitespace="preserve">A return value.</doc>
-            <type name="gint" c:type="gint*"/>
-          </parameter>
-          <parameter name="c" transfer-ownership="none">
-            <doc xml:whitespace="preserve">Other parameter.</doc>
-            <type name="gdouble" c:type="gdouble"/>
-          </parameter>
-        </parameters>
-      </method>
       <method name="skipped_method"
               c:identifier="foo_object_skipped_method"
               introspectable="0">
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 90c9320..4d915b8 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -534,6 +534,58 @@ case.</doc>
           </parameter>
         </parameters>
       </method>
+      <method name="skip_param"
+              c:identifier="regress_test_obj_skip_param"
+              throws="1">
+        <doc xml:whitespace="preserve">Check that the return value is skipped</doc>
+        <return-value transfer-ownership="none">
+          <doc xml:whitespace="preserve">%TRUE if the call succeeds, %FALSE if @error is set.</doc>
+          <type name="gboolean" c:type="gboolean"/>
+        </return-value>
+        <parameters>
+          <parameter name="a" transfer-ownership="none">
+            <doc xml:whitespace="preserve">Parameter.</doc>
+            <type name="gint" c:type="gint"/>
+          </parameter>
+          <parameter name="out_b"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
+            <doc xml:whitespace="preserve">Return value.</doc>
+            <type name="gint" c:type="gint*"/>
+          </parameter>
+          <parameter name="c" transfer-ownership="none" skip="1">
+            <doc xml:whitespace="preserve">Other parameter.</doc>
+            <type name="gdouble" c:type="gdouble"/>
+          </parameter>
+        </parameters>
+      </method>
+      <method name="skip_return_val"
+              c:identifier="regress_test_obj_skip_return_val"
+              throws="1">
+        <doc xml:whitespace="preserve">Check that the return value is skipped</doc>
+        <return-value transfer-ownership="none" skip="1">
+          <doc xml:whitespace="preserve">%TRUE if the call succeeds, %FALSE if @error is set.</doc>
+          <type name="gboolean" c:type="gboolean"/>
+        </return-value>
+        <parameters>
+          <parameter name="a" transfer-ownership="none">
+            <doc xml:whitespace="preserve">Parameter.</doc>
+            <type name="gint" c:type="gint"/>
+          </parameter>
+          <parameter name="out_b"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
+            <doc xml:whitespace="preserve">A return value.</doc>
+            <type name="gint" c:type="gint*"/>
+          </parameter>
+          <parameter name="c" transfer-ownership="none">
+            <doc xml:whitespace="preserve">Other parameter.</doc>
+            <type name="gdouble" c:type="gdouble"/>
+          </parameter>
+        </parameters>
+      </method>
       <method name="torture_signature_0"
               c:identifier="regress_test_obj_torture_signature_0">
         <return-value transfer-ownership="none">
diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c
index 6270b61..8b8b40d 100644
--- a/tests/scanner/foo.c
+++ b/tests/scanner/foo.c
@@ -707,49 +707,6 @@ foo_skip_me (FooSkippable fs)
 }
 
 /**
- * foo_object_skip_return_val:
- * @object: a #FooObject
- * @a: Parameter.
- * @out_b: (out): A return value.
- * @c: Other parameter.
- * @error: Return location for error.
- *
- * Check that the return value is skipped
- *
- * Returns: (skip): %TRUE if the call succeeds, %FALSE if @error is set.
- */
-gboolean
-foo_object_skip_return_val (FooObject  *object,
-                            gint        a,
-                            gint       *out_b,
-                            gdouble     c,
-                            GError    **error)
-{
-  return TRUE;
-}
-
-/**
- * foo_object_skip_param:
- * @object: A #FooObject.
- * @a: Parameter.
- * @out_b: (out): Return value.
- * @c: (skip): Other parameter.
- *
- * Check that the return value is skipped
- *
- * Returns: %TRUE if the call succeeds, %FALSE if @error is set.
- */
-gboolean
-foo_object_skip_param (FooObject *object,
-                       gint       a,
-                       gint      *out_b,
-                       gdouble    c,
-                       GError   **error)
-{
-  return TRUE;
-}
-
-/**
  * FooForeignStruct: (foreign)
  *
  */
diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h
index 997799d..e648e60 100644
--- a/tests/scanner/foo.h
+++ b/tests/scanner/foo.h
@@ -416,18 +416,6 @@ typedef enum {
 } FooSkippable;
 void foo_skip_me (FooSkippable fs);
 
-gboolean foo_object_skip_return_val (FooObject  *object,
-                                     gint        a,
-                                     gint       *out_b,
-                                     gdouble     c,
-                                     GError    **error);
-
-gboolean foo_object_skip_param (FooObject *object,
-                                gint       a,
-                                gint      *out_b,
-                                gdouble    c,
-                                GError   **error);
-
 typedef struct _FooForeignStruct           FooForeignStruct;
 
 struct _FooForeignStruct
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 27031b1..f8a552b 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -2033,6 +2033,55 @@ regress_test_obj_torture_signature_1 (RegressTestObj   *obj,
 }
 
 /**
+ * regress_test_obj_skip_return_val:
+ * @obj: a #RegressTestObj
+ * @a: Parameter.
+ * @out_b: (out): A return value.
+ * @c: Other parameter.
+ * @error: Return location for error.
+ *
+ * Check that the return value is skipped
+ *
+ * Returns: (skip): %TRUE if the call succeeds, %FALSE if @error is set.
+ */
+gboolean
+regress_test_obj_skip_return_val (RegressTestObj  *obj,
+                                  gint             a,
+                                  gint            *out_b,
+                                  gdouble          c,
+                                  GError         **error)
+{
+  if (a == 0)
+    return TRUE;
+  g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "a is non-zero");
+  return FALSE;
+}
+
+/**
+ * regress_test_obj_skip_param:
+ * @obj: A #RegressTestObj.
+ * @a: Parameter.
+ * @out_b: (out): Return value.
+ * @c: (skip): Other parameter.
+ *
+ * Check that the return value is skipped
+ *
+ * Returns: %TRUE if the call succeeds, %FALSE if @error is set.
+ */
+gboolean
+regress_test_obj_skip_param (RegressTestObj *obj,
+                             gint            a,
+                             gint           *out_b,
+                             gdouble         c,
+                             GError        **error)
+{
+  if (a == 0)
+    return TRUE;
+  g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "a is non-zero");
+  return FALSE;
+}
+
+/**
  * regress_test_obj_do_matrix:
  * @obj: A #RegressTestObj
  * @somestr: Meaningless string
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index aafc25c..562e8a4 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -352,6 +352,18 @@ gboolean regress_test_obj_torture_signature_1 (RegressTestObj    *obj,
                                        guint       m,
                                        GError    **error);
 
+gboolean regress_test_obj_skip_return_val (RegressTestObj  *obj,
+                                           gint             a,
+                                           gint            *out_b,
+                                           gdouble          c,
+                                           GError         **error);
+
+gboolean regress_test_obj_skip_param (RegressTestObj *obj,
+                                      gint            a,
+                                      gint           *out_b,
+                                      gdouble         c,
+                                      GError        **error);
+
 /* virtual */
 int        regress_test_obj_do_matrix (RegressTestObj *obj, const char *somestr);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]