Add an enum param test function
authorJohan Dahlin <jdahlin@async.com.br>
Fri, 23 Jan 2009 14:12:21 +0000 (14:12 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Fri, 23 Jan 2009 14:12:21 +0000 (14:12 +0000)
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

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

index 1bba343..d2f2dbd 100644 (file)
--- 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:
index 434401f..c30fbb7 100644 (file)
@@ -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 */
 
 /**
index 22f1838..29ec8d7 100644 (file)
@@ -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;