summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-05-13 18:24:50 -0400
committerDavid Zeuthen <davidz@redhat.com>2011-05-13 18:25:46 -0400
commit7bcc7ee5e57ea9d722868fa4340217ab7584cde0 (patch)
treef9af1e4ed78ede1091a6952853d5a7c3a27b2912 /tests
parent1e8e36ad1875c55ed640d53e03cf891ea398ad8a (diff)
downloadgobject-introspection-7bcc7ee5e57ea9d722868fa4340217ab7584cde0.tar.gz
Move recently added (skip) tests to the regress module
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Foo-1.0-expected.gir52
-rw-r--r--tests/scanner/Regress-1.0-expected.gir52
-rw-r--r--tests/scanner/foo.c43
-rw-r--r--tests/scanner/foo.h12
-rw-r--r--tests/scanner/regress.c49
-rw-r--r--tests/scanner/regress.h12
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 64f40db2..fa5ee930 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 90c93202..4d915b89 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 6270b615..8b8b40d0 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 997799d2..e648e609 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 27031b1e..f8a552b0 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 aafc25c6..562e8a4c 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);