diff options
author | Johan Dahlin <jdahlin@async.com.br> | 2009-01-23 14:12:21 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2009-01-23 14:12:21 +0000 |
commit | 6c0c0eeff5246facec1e5f102d9cc2a45a9db339 (patch) | |
tree | 555bd0b47d9006138273d32bdcfe5c4160089022 | |
parent | 1249b4176b15b244c672b90ee153225e910cbc8b (diff) | |
download | gobject-introspection-6c0c0eeff5246facec1e5f102d9cc2a45a9db339.tar.gz |
Add an enum param test function
2009-01-23 Johan Dahlin <jdahlin@async.com.br>
* tests/everything/everything.c (test_enum_param):
* tests/everything/everything.h:
Add an enum param test function
svn path=/trunk/; revision=1066
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/everything/everything.c | 14 | ||||
-rw-r--r-- | tests/everything/everything.h | 2 |
3 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,10 @@ +2009-01-23 Johan Dahlin <jdahlin@async.com.br> + + * tests/everything/everything.c (test_enum_param): + * tests/everything/everything.h: + + Add an enum param test function + 2009-01-21 Johan Dahlin <jdahlin@async.com.br> * configure.ac: diff --git a/tests/everything/everything.c b/tests/everything/everything.c index 434401fd..c30fbb7d 100644 --- a/tests/everything/everything.c +++ b/tests/everything/everything.c @@ -544,6 +544,20 @@ test_flags_get_type (void) return etype; } +const gchar * +test_enum_param(TestEnum e) +{ + GEnumValue *ev; + GEnumClass *ec; + + ec = g_type_class_ref (test_enum_get_type ()); + ev = g_enum_get_value (ec, e); + g_type_class_unref (ec); + + return ev->value_nick; + +} + /* structures */ /** diff --git a/tests/everything/everything.h b/tests/everything/everything.h index 22f18383..29ec8d70 100644 --- a/tests/everything/everything.h +++ b/tests/everything/everything.h @@ -95,6 +95,8 @@ GType test_enum_get_type (void) G_GNUC_CONST; GType test_flags_get_type (void) G_GNUC_CONST; #define TES_TYPE_FLAGS (test_flags_get_type ()) +const gchar * test_enum_param(TestEnum e); + /* structures */ typedef struct _TestStructA TestStructA; typedef struct _TestStructB TestStructB; |