[gobject-introspection] gimarshalingtests: Add tests for multiple utf8 args with allow-none
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] gimarshalingtests: Add tests for multiple utf8 args with allow-none
- Date: Thu, 26 Sep 2013 11:42:20 +0000 (UTC)
commit a19bfeb4da53825ad960c9e33306b9437a22c4f6
Author: Simon Feltman <sfeltman src gnome org>
Date: Sat Jul 27 17:54:59 2013 -0700
gimarshalingtests: Add tests for multiple utf8 args with allow-none
Add test function which accepts multiple allow-none utf8 arguments.
This can be used for testing a default of NULL for unsupplied
arguments annotated with allow-none.
https://bugzilla.gnome.org/show_bug.cgi?id=640812
tests/gimarshallingtests.c | 18 ++++++++++++++++++
tests/gimarshallingtests.h | 2 ++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 7d39254..b1bce8f 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -4735,6 +4735,24 @@ gi_marshalling_tests_int_return_out (gint *int_)
return 6;
}
+/**
+* gi_marshalling_tests_int_two_in_utf8_two_in_with_allow_none:
+* @a: (in):
+* @b: (in):
+* @c: (in) (allow-none): Must be "3" or NULL
+* @d: (in) (allow-none): Must be "4" or NULL
+*/
+void
+gi_marshalling_tests_int_two_in_utf8_two_in_with_allow_none (gint a, gint b, const gchar *c, const gchar *d)
+{
+ g_assert_cmpint (a, ==, 1);
+ g_assert_cmpint (b, ==, 2);
+ if (c != NULL)
+ g_assert_cmpstr (c, ==, "3");
+ if (d != NULL)
+ g_assert_cmpstr (d, ==, "4");
+}
+
/* GError */
void
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 3b436f0..e308db6 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -1047,6 +1047,8 @@ void gi_marshalling_tests_int_three_in_three_out(gint a, gint b, gint c,
gint *out0, gint *out1, gint *out2);
gint gi_marshalling_tests_int_return_out (gint *int_);
+/* Default arguments */
+void gi_marshalling_tests_int_two_in_utf8_two_in_with_allow_none (gint a, gint b, const gchar *c, const
gchar *d);
/* GError */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]