From: Johan Bilien Date: Tue, 9 Dec 2008 15:27:47 +0000 (+0000) Subject: Bug 562545 – Add function taking / returning GValue X-Git-Tag: GOBJECT_INTROSPECTION_0_6_2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96d1b5d0efb045dd6f7cc42f6ea48f773d643fec;p=platform%2Fupstream%2Fgobject-introspection.git Bug 562545 – Add function taking / returning GValue 2008-12-09 Johan Bilien 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 --- diff --git a/ChangeLog b/ChangeLog index ac7f810..b5c7d5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-09 Johan Bilien + + 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 * giscanner/cachestore.py (CacheStore.store): Use diff --git a/tests/everything/everything.c b/tests/everything/everything.c index c0bff6a..4c72692 100644 --- a/tests/everything/everything.c +++ b/tests/everything/everything.c @@ -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 */ diff --git a/tests/everything/everything.h b/tests/everything/everything.h index 76f76fe..61a6b7d 100644 --- a/tests/everything/everything.h +++ b/tests/everything/everything.h @@ -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