summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-23 14:12:21 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-23 14:12:21 +0000
commit6c0c0eeff5246facec1e5f102d9cc2a45a9db339 (patch)
tree555bd0b47d9006138273d32bdcfe5c4160089022
parent1249b4176b15b244c672b90ee153225e910cbc8b (diff)
downloadgobject-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--ChangeLog7
-rw-r--r--tests/everything/everything.c14
-rw-r--r--tests/everything/everything.h2
3 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bba343c..d2f2dbd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;