Bug 562545 – Add function taking / returning GValue
authorJohan Bilien <jobi@via.ecp.fr>
Tue, 9 Dec 2008 15:27:47 +0000 (15:27 +0000)
committerJohan Bilien <jobi@src.gnome.org>
Tue, 9 Dec 2008 15:27:47 +0000 (15:27 +0000)
2008-12-09  Johan Bilien  <jobi@via.ecp.fr>

Bug 562545 – Add function taking / returning GValue

* tests/everything/everything.[ch]: add a test of function taking and
returning "const GValue *"

svn path=/trunk/; revision=990

ChangeLog
tests/everything/everything.c
tests/everything/everything.h

index ac7f810..b5c7d5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-09  Johan Bilien  <jobi@via.ecp.fr>
+
+       Bug 562545 – Add function taking / returning GValue
+
+       * tests/everything/everything.[ch]: add a test of function taking and
+       returning "const GValue *"
+
 2008-12-09  Johan Dahlin  <johan@async.com.br>
 
        * giscanner/cachestore.py (CacheStore.store): Use
index c0bff6a..4c72692 100644 (file)
@@ -142,6 +142,37 @@ int test_closure_one_arg (GClosure *closure, int arg)
   return ret;
 }
 
+/**
+ * test_value_arg
+ * @v: (transfer none): a GValue expected to contain an int
+ *
+ * Return value: the int contained in the GValue.
+ */
+int test_int_value_arg(const GValue *v) {
+  int i;
+
+  i = g_value_get_int (v);
+
+  return i;
+}
+
+static GValue value;
+/**
+ * test_value_return:
+ * @i: an int
+ *
+ * Return value: (transfer none): the int wrapped in a GValue.
+ */
+const GValue *test_value_return(int i) {
+  memset(&value, '\0', sizeof(GValue));
+
+  g_value_init (&value, G_TYPE_INT);
+  g_value_set_int (&value, i);
+
+  return &value;
+}
+
+
 #if 0
 /************************************************************************/
 /* utf8 */
index 76f76fe..61a6b7d 100644 (file)
@@ -70,6 +70,10 @@ void test_gslist_free (GSList *in);
 int test_closure (GClosure *closure);
 int test_closure_one_arg (GClosure *closure, int arg);
 
+/* value */
+int test_int_value_arg(const GValue *v);
+const GValue *test_value_return(int i);
+
 /* enums / flags */
 
 typedef enum