[glibmm/gmmproc-refactor] Add a test for optional parameters.



commit c3d1d501815605ec6dde244852e53fe08dfc942e
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Jun 11 23:49:48 2012 +0200

    Add a test for optional parameters.

 tools/pm/tests/libgm/gm/gm-obj.c     |   14 ++++++++++++++
 tools/pm/tests/libgm/gm/gm-obj.h     |    4 ++++
 tools/pm/tests/libgmmm/gm/src/obj.hg |    2 +-
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/tools/pm/tests/libgm/gm/gm-obj.c b/tools/pm/tests/libgm/gm/gm-obj.c
index 746e5b6..cf7a880 100644
--- a/tools/pm/tests/libgm/gm/gm-obj.c
+++ b/tools/pm/tests/libgm/gm/gm-obj.c
@@ -802,3 +802,17 @@ gm_obj_get_other_t_n (GmObj* obj)
 
   return obj->priv->other;
 }
+
+/**
+ * gm_obj_set_string_allow_none:
+ * @obj: A #GmObj.
+ * @str: (transfer none) (allow-none): A string or %NULL.
+ *
+ * Does nothing actually.
+ */
+void
+gm_obj_set_string_allow_none (GmObj* obj,
+                              const gchar* str)
+{
+  g_return_if_fail (GM_IS_OBJ (obj));
+}
diff --git a/tools/pm/tests/libgm/gm/gm-obj.h b/tools/pm/tests/libgm/gm/gm-obj.h
index a900d8f..e7bb863 100644
--- a/tools/pm/tests/libgm/gm/gm-obj.h
+++ b/tools/pm/tests/libgm/gm/gm-obj.h
@@ -140,6 +140,10 @@ gm_obj_get_other_t_f (GmObj* obj);
 GmOther*
 gm_obj_get_other_t_n (GmObj* obj);
 
+void
+gm_obj_set_string_allow_none (GmObj* obj,
+                              const gchar* str);
+
 G_END_DECLS
 
 #endif /* GLIBMM_TEST_GM_OBJ_H */
diff --git a/tools/pm/tests/libgmmm/gm/src/obj.hg b/tools/pm/tests/libgmmm/gm/src/obj.hg
index b138171..af04e24 100644
--- a/tools/pm/tests/libgmmm/gm/src/obj.hg
+++ b/tools/pm/tests/libgmmm/gm/src/obj.hg
@@ -70,7 +70,7 @@ public:
   _WRAP_METHOD(void set_string_t_f(const Glib::ustring& string), gm_obj_set_string_t_f)
   _WRAP_METHOD(void set_string_t_n(const Glib::ustring& string), gm_obj_set_string_t_n)
 
-
+  _WRAP_METHOD(void set_string_allow_none(const Glib::ustring& str{?}), gm_obj_set_string_allow_none)
 
 
   _WRAP_PROPERTY("number", int)



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