diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index f0307dd..2e6df75 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -316,9 +316,12 @@ GFlagsValue
 g_enum_get_value
 g_enum_get_value_by_name
 g_enum_get_value_by_nick
+g_enum_get_value_from_string
 g_flags_get_first_value
 g_flags_get_value_by_name
 g_flags_get_value_by_nick
+g_flags_get_first_value_from_string
+g_flags_get_value_from_string
 g_enum_register_static
 g_flags_register_static
 g_enum_complete_type_info
diff --git a/gobject/genums.c b/gobject/genums.c
index b49cae5..2da2c7c 100644
--- a/gobject/genums.c
+++ b/gobject/genums.c
@@ -1,5 +1,7 @@
 /* GObject - GLib Type, Object, Parameter and Signal Library
  * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ * Copyright (C) 1998-2002 James Henstridge <james@daa.com.au> and
+ *                         libglade contributors
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -622,5 +624,167 @@ g_value_get_flags (const GValue *value)
   return value->data[0].v_ulong;
 }
 
+/**
+ * g_enum_get_value_from_string:
+ * @enum_class: the enum class to translate to
+ * @string: string to parse containing a numeric or a literal name, or
+ * a nick.
+ *
+ * @string is converted to a number first, and returned as a matching
+ * %GEnumValue. If it fails, it is matched with the enum names, and
+ * finally with enum nick names.
+ *
+ * Returns: a %GEnumValue if @string was successfully translated
+ *          to a valid enum value, or %NULL.
+ *
+ * Since: 2.20
+ **/
+const GEnumValue *
+g_enum_get_value_from_string (GEnumClass  *enum_class,
+			      const gchar *string)
+{
+  GEnumValue *enum_value = NULL;
+  gchar *endptr;
+  gint ret;
+
+  g_return_val_if_fail (G_IS_ENUM_CLASS (enum_class), NULL);
+  g_return_val_if_fail (string != NULL, NULL);
+
+  ret = g_ascii_strtoll (string, &endptr, 0);
+  if (endptr != string
+      && endptr == (string + strlen (string))) /* parsed a number */
+    enum_value = g_enum_get_value (enum_class, ret);
+
+  if (!enum_value)
+    {
+      enum_value = g_enum_get_value_by_name (enum_class, string);
+      if (!enum_value)
+	enum_value = g_enum_get_value_by_nick (enum_class, string);
+    }
+
+  return enum_value;
+}
+
+/**
+ * g_flags_get_first_value_from_string:
+ * @flags_class: the flags class to translate to
+ * @string: string to parse containing a numeric or `|' separated list
+ * of literal names, or nicks.
+ *
+ * Returns: the first #GFlagsValue which is set in @value, or %NULL if
+ *          none is set
+ *
+ * Since: 2.20
+ **/
+const GFlagsValue *
+g_flags_get_first_value_from_string (GFlagsClass *flags_class,
+				     const gchar *string)
+{
+  return g_flags_get_first_value (flags_class, g_flags_get_value_from_string (flags_class, string));
+}
+
+/**
+ * g_flags_get_value_from_string:
+ * @flags_class: the flags class to translate to
+ * @string: string to parse containing a numeric or `|' separated list
+ * of literal names, or nicks.
+ *
+ * Returns: the combination of flags values converted from @string, or 0
+ *
+ * Since: 2.20
+ **/
+guint
+g_flags_get_value_from_string (GFlagsClass    *flags_class,
+                               const gchar    *string)
+{
+  GFlagsValue *flags_value = NULL;
+  gchar *endptr, *prevptr;
+  guint i, j, correct, value;
+  gchar *flagstr;
+  const gchar *flag;
+  gunichar ch;
+  gboolean eos;
+
+  g_return_val_if_fail (G_IS_FLAGS_CLASS (flags_class), 0);
+  g_return_val_if_fail (string != NULL, 0);
+
+  correct = TRUE;
+
+  value = g_ascii_strtoull (string, &endptr, 0);
+  if (endptr != string
+      && endptr == (string + strlen (string))) /* parsed a number */
+    {
+      if (value & ~flags_class->mask) {
+	correct = FALSE;
+	value = 0;
+      }
+    }
+  else
+    {
+
+      flagstr = g_strdup (string);
+      for (value = i = j = 0; ; i++)
+	{
+
+	  eos = flagstr[i] == '\0';
+
+	  if (!eos && flagstr[i] != '|')
+	    continue;
+
+	  flag = &flagstr[j];
+	  endptr = &flagstr[i];
+
+	  if (!eos)
+	    {
+	      flagstr[i++] = '\0';
+	      j = i;
+	    }
+
+	  /* trim spaces */
+	  for (;;)
+	    {
+	      ch = g_utf8_get_char (flag);
+	      if (!g_unichar_isspace (ch))
+		break;
+	      flag = g_utf8_next_char (flag);
+	    }
+
+	  while (endptr > flag)
+	    {
+	      prevptr = g_utf8_prev_char (endptr);
+	      ch = g_utf8_get_char (prevptr);
+	      if (!g_unichar_isspace (ch))
+		break;
+	      endptr = prevptr;
+	    }
+
+	  if (endptr > flag)
+	    {
+	      *endptr = '\0';
+	      flags_value = g_flags_get_value_by_name (flags_class, flag);
+
+	      if (!flags_value)
+		flags_value = g_flags_get_value_by_nick (flags_class, flag);
+
+	      if (flags_value)
+		value |= flags_value->value;
+	      else
+		{
+		  correct = FALSE;
+		  value = 0;
+		  break;
+		}
+	    }
+
+	  if (eos)
+	    break;
+	}
+
+      g_free (flagstr);
+    }
+
+  return value;
+}
+
 #define __G_ENUMS_C__
 #include "gobjectaliasdef.c"
diff --git a/gobject/genums.h b/gobject/genums.h
index 32e885c..03ff994 100644
--- a/gobject/genums.h
+++ b/gobject/genums.h
@@ -229,6 +229,12 @@ GFlagsValue*	g_flags_get_value_by_name	(GFlagsClass	*flags_class,
 						 const gchar	*name);
 GFlagsValue*	g_flags_get_value_by_nick	(GFlagsClass	*flags_class,
 						 const gchar	*nick);
+const GEnumValue* g_enum_get_value_from_string  (GEnumClass     *enum_class,
+                                                 const gchar    *string);
+const GFlagsValue* g_flags_get_first_value_from_string (GFlagsClass *flags_class,
+                                                 const gchar    *string);
+guint           g_flags_get_value_from_string   (GFlagsClass    *flags_class,
+                                                 const gchar    *string);
 void            g_value_set_enum        	(GValue         *value,
 						 gint            v_enum);
 gint            g_value_get_enum        	(const GValue   *value);
@@ -237,7 +243,6 @@ void            g_value_set_flags       	(GValue         *value,
 guint           g_value_get_flags       	(const GValue   *value);
 
 
-
 /* --- registration functions --- */
 /* const_static_values is a NULL terminated array of enum/flags
  * values that is taken over!
diff --git a/gobject/gobject.symbols b/gobject/gobject.symbols
index 7a98dc3..740f4e6 100644
--- a/gobject/gobject.symbols
+++ b/gobject/gobject.symbols
@@ -87,11 +87,14 @@ g_enum_complete_type_info
 g_enum_get_value
 g_enum_get_value_by_name
 g_enum_get_value_by_nick
+g_enum_get_value_from_string
 g_enum_register_static
 g_flags_complete_type_info
 g_flags_get_first_value
 g_flags_get_value_by_name
 g_flags_get_value_by_nick
+g_flags_get_first_value_from_string
+g_flags_get_value_from_string
 g_flags_register_static
 g_value_set_enum
 g_value_set_flags
@@ -324,7 +327,7 @@ g_type_add_interface_dynamic
 g_type_add_interface_static
 g_type_check_class_cast
 g_type_check_class_is_a
-g_type_check_instance 
+g_type_check_instance
 g_type_check_instance_cast
 g_type_check_instance_is_a
 g_type_check_is_value_type
diff --git a/gobject/gvaluetransform.c b/gobject/gvaluetransform.c
index e1c3bba..a487540 100644
--- a/gobject/gvaluetransform.c
+++ b/gobject/gvaluetransform.c
@@ -239,7 +239,30 @@ value_transform_flags_string (const GValue *src_value,
   
   g_type_class_unref (class);
 }
+static void
+value_transform_string_enum (const GValue *src_value,
+                             GValue       *dest_value)
+{
+  GEnumClass *class = g_type_class_ref (G_VALUE_TYPE (dest_value));
+  const GEnumValue* enum_value;
+
+  enum_value = g_enum_get_value_from_string (class, src_value->data[0].v_pointer);
+  if (enum_value)
+    dest_value->data[0].v_long = enum_value->value;
+
+  g_type_class_unref (class);
 
+}
+static void
+value_transform_string_flags (const GValue *src_value,
+                              GValue       *dest_value)
+{
+  GFlagsClass *class = g_type_class_ref (G_VALUE_TYPE (dest_value));
+
+  dest_value->data[0].v_ulong = g_flags_get_value_from_string (class, src_value->data[0].v_pointer);
+
+  g_type_class_unref (class);
+}
 
 /* registration
  */
@@ -440,4 +463,6 @@ g_value_transforms_init (void)
   g_value_register_transform_func (G_TYPE_DOUBLE,       G_TYPE_STRING,          value_transform_double_string);
   /* string types */
   g_value_register_transform_func (G_TYPE_STRING,       G_TYPE_STRING,          value_transform_string_string);
+  g_value_register_transform_func (G_TYPE_STRING,       G_TYPE_ENUM,            value_transform_string_enum);
+  g_value_register_transform_func (G_TYPE_STRING,       G_TYPE_FLAGS,           value_transform_string_flags);
 }
diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am
index d610366..ef5e270 100644
--- a/tests/gobject/Makefile.am
+++ b/tests/gobject/Makefile.am
@@ -47,9 +47,13 @@ CLEANFILES = stamp-testmarshal.h
 
 LDADD = libtestgobject.la $(libgobject) 
 
+noinst_PROGRAMS = $(TEST_PROGS)
+
+TEST_PROGS          += gvalue-test
+gvalue_test_SOURCES  = gvalue-test.c
+
 test_programs =					\
 	deftype					\
-	gvalue-test				\
 	paramspec-test				\
 	accumulator				\
 	defaultiface				\
diff --git a/tests/gobject/gvalue-test.c b/tests/gobject/gvalue-test.c
index 2d721e0..dfd81c4 100644
--- a/tests/gobject/gvalue-test.c
+++ b/tests/gobject/gvalue-test.c
@@ -21,7 +21,7 @@
  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GLib Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GLib at ftp://ftp.gtk.org/pub/gtk/. 
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
  */
 
 #undef G_DISABLE_ASSERT
@@ -34,62 +34,119 @@
 #include "gobject/gvaluecollector.h"
 
 static void
-test_enum_transformation (void)
-{ 
-  GType type; 
+test_enum_transformation (void         *unused,
+                          gconstpointer test_data)
+{
+  GType type;
   GValue orig = { 0, };
-  GValue xform = { 0, }; 
-  GEnumValue values[] = { {0,"0","0"}, {1,"1","1"}}; 
-  
- type = g_enum_register_static ("TestEnum", values); 
-  
- g_value_init (&orig, type); 
- g_value_set_enum (&orig, 1); 
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_CHAR); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_char (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_UCHAR); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_uchar (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_INT); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_int (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_UINT); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_uint (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_LONG); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_long (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_ULONG); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_ulong (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_INT64); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_int64 (&xform) == 1);
-
- memset (&xform, 0, sizeof (GValue));
- g_value_init (&xform, G_TYPE_UINT64); 
- g_value_transform (&orig, &xform); 
- g_assert (g_value_get_uint64 (&xform) == 1);
+  GValue xform = { 0, };
+  GEnumValue values[] = { {0,"0_NAME","0_NICK"}, {1,"1_NAME","1_NICK"}};
+
+  type = g_enum_register_static ("TestEnum", values);
+
+  g_value_init (&orig, type);
+  g_value_set_enum (&orig, 1);
+
+  g_value_init (&xform, G_TYPE_CHAR);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_char (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_UCHAR);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_uchar (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_INT);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_int (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_UINT);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_uint (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_LONG);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_long (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_ULONG);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_ulong (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_INT64);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_int64 (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_UINT64);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_uint64 (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_init (&xform, G_TYPE_STRING);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpstr (g_value_get_string (&xform), ==, "1_NAME");
+  g_value_unset (&xform);
+
+  g_value_unset (&orig);
+  g_value_init (&orig, G_TYPE_STRING);
+  g_value_set_string (&orig, "1_NAME");
+
+  g_value_init (&xform, type);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_enum (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_unset (&orig);
 }
 
+static void
+test_flags_transformation (void         *unused,
+                           gconstpointer test_data)
+{
+  GType type;
+  GValue orig = { 0, };
+  GValue xform = { 0, };
+  GFlagsValue values[] = { {1 << 0,"1_NAME","1_NICK"}, {1 << 1,"2_NAME","2_NICK"}};
+
+  type = g_flags_register_static ("TestFlags", values);
+
+  g_value_init (&orig, type);
+  g_value_set_flags (&orig, 3);
+
+  g_value_init (&xform, G_TYPE_CHAR);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_char (&xform), ==, 3);
+  g_value_unset (&xform);
+
+  g_value_unset (&orig);
+  g_value_init (&orig, G_TYPE_STRING);
+  g_value_set_string (&orig, "1_NAME");
+
+  g_value_init (&xform, type);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_flags (&xform), ==, 1);
+  g_value_unset (&xform);
+
+  g_value_unset (&orig);
+  g_value_init (&orig, G_TYPE_STRING);
+  g_value_set_string (&orig, "1_NAME|2_NICK");
+
+  g_value_init (&xform, type);
+  g_value_transform (&orig, &xform);
+  g_assert_cmpint (g_value_get_flags (&xform), ==, 3);
+  g_value_unset (&xform);
+
+  g_value_unset (&orig);
+}
 
 static void
-test_gtype_value (void)
+test_gtype_value (void         *unused,
+                  gconstpointer test_data)
 {
   GType type;
   GValue value = { 0, };
@@ -99,12 +156,12 @@ test_gtype_value (void)
 
   g_value_set_gtype (&value, G_TYPE_BOXED);
   type = g_value_get_gtype (&value);
-  g_assert (type == G_TYPE_BOXED);
+  g_assert_cmpint (type, ==, G_TYPE_BOXED);
 
   g_value_init (&copy, G_TYPE_GTYPE);
   g_value_copy (&value, &copy);
   type = g_value_get_gtype (&copy);
-  g_assert (type == G_TYPE_BOXED);
+  g_assert_cmpint (type, ==, G_TYPE_BOXED);
 }
 
 static gchar *
@@ -120,7 +177,7 @@ collect (GValue *value, ...)
   va_end (var_args);
 
   return error;
-}	 
+}
 
 static gchar *
 lcopy (GValue *value, ...)
@@ -135,94 +192,96 @@ lcopy (GValue *value, ...)
   va_end (var_args);
 
   return error;
-}	 
+}
 
 static void
-test_collection (void)
+test_collection (void         *unused,
+                 gconstpointer test_data)
 {
   GValue value = { 0, };
   gchar *error;
-  
+
   g_value_init (&value, G_TYPE_CHAR);
   error = collect (&value, 'c');
   g_assert (error == NULL);
-  g_assert (g_value_get_char (&value) == 'c');
-  
+  g_assert_cmpint (g_value_get_char (&value), ==, 'c');
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_UCHAR);
   error = collect (&value, 129);
   g_assert (error == NULL);
-  g_assert (g_value_get_uchar (&value) == 129);
-  
+  g_assert_cmpint (g_value_get_uchar (&value), ==, 129);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_BOOLEAN);
   error = collect (&value, TRUE);
   g_assert (error == NULL);
-  g_assert (g_value_get_boolean (&value) == TRUE);
-  
+  g_assert_cmpint (g_value_get_boolean (&value), ==, TRUE);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_INT);
   error = collect (&value, G_MAXINT);
   g_assert (error == NULL);
-  g_assert (g_value_get_int (&value) == G_MAXINT);
-  
+  g_assert_cmpint (g_value_get_int (&value), ==, G_MAXINT);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_UINT);
   error = collect (&value, G_MAXUINT);
   g_assert (error == NULL);
-  g_assert (g_value_get_uint (&value) == G_MAXUINT);
-  
-  g_value_unset (&value);  
+  g_assert_cmpint (g_value_get_uint (&value), ==, G_MAXUINT);
+
+  g_value_unset (&value);
   g_value_init (&value, G_TYPE_LONG);
   error = collect (&value, G_MAXLONG);
   g_assert (error == NULL);
-  g_assert (g_value_get_long (&value) == G_MAXLONG);
-  
+  g_assert_cmpint (g_value_get_long (&value), ==, G_MAXLONG);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_ULONG);
   error = collect (&value, G_MAXULONG);
   g_assert (error == NULL);
-  g_assert (g_value_get_ulong (&value) == G_MAXULONG);
-  
-  g_value_unset (&value);  
+  g_assert_cmpint (g_value_get_ulong (&value), ==, G_MAXULONG);
+
+  g_value_unset (&value);
   g_value_init (&value, G_TYPE_INT64);
   error = collect (&value, G_MAXINT64);
   g_assert (error == NULL);
-  g_assert (g_value_get_int64 (&value) == G_MAXINT64);
-  
+  g_assert_cmpint (g_value_get_int64 (&value), ==, G_MAXINT64);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_UINT64);
   error = collect (&value, G_MAXUINT64);
   g_assert (error == NULL);
-  g_assert (g_value_get_uint64 (&value) == G_MAXUINT64);
-  
+  g_assert_cmpint (g_value_get_uint64 (&value), ==, G_MAXUINT64);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_FLOAT);
   error = collect (&value, G_MAXFLOAT);
   g_assert (error == NULL);
-  g_assert (g_value_get_float (&value) == G_MAXFLOAT);
-  
+  g_assert_cmpfloat (g_value_get_float (&value), ==, G_MAXFLOAT);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_DOUBLE);
   error = collect (&value, G_MAXDOUBLE);
   g_assert (error == NULL);
-  g_assert (g_value_get_double (&value) == G_MAXDOUBLE);
-  
+  g_assert_cmpfloat (g_value_get_double (&value), ==, G_MAXDOUBLE);
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_STRING);
   error = collect (&value, "string ?");
   g_assert (error == NULL);
-  g_assert (strcmp (g_value_get_string (&value), "string ?") == 0);
-  
+  g_assert_cmpstr (g_value_get_string (&value), ==, "string ?");
+
   g_value_unset (&value);
   g_value_init (&value, G_TYPE_GTYPE);
   error = collect (&value, G_TYPE_BOXED);
   g_assert (error == NULL);
-  g_assert (g_value_get_gtype (&value) == G_TYPE_BOXED);
+  g_assert_cmpint (g_value_get_gtype (&value), ==, G_TYPE_BOXED);
 }
 
 static void
-test_copying (void)
+test_copying (void         *unused,
+              gconstpointer test_data)
 {
   GValue value = { 0, };
   gchar *error;
@@ -234,8 +293,8 @@ test_copying (void)
     g_value_set_char (&value, 'c');
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == 'c');
-  }  
+    g_assert_cmpint (c, ==, 'c');
+  }
 
   {
     guchar c = 0;
@@ -245,8 +304,8 @@ test_copying (void)
     g_value_set_uchar (&value, 129);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == 129);
-  }  
+    g_assert_cmpint (c, ==, 129);
+  }
 
   {
     gint c = 0;
@@ -256,8 +315,8 @@ test_copying (void)
     g_value_set_int (&value, G_MAXINT);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXINT);
-  }  
+    g_assert_cmpint (c, ==, G_MAXINT);
+  }
 
   {
     guint c = 0;
@@ -267,8 +326,8 @@ test_copying (void)
     g_value_set_uint (&value, G_MAXUINT);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXUINT);
-  }  
+    g_assert_cmpint (c, ==, G_MAXUINT);
+  }
 
   {
     glong c = 0;
@@ -278,8 +337,8 @@ test_copying (void)
     g_value_set_long (&value, G_MAXLONG);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXLONG);
-  }  
+    g_assert_cmpint (c, ==, G_MAXLONG);
+  }
 
   {
     gulong c = 0;
@@ -289,8 +348,8 @@ test_copying (void)
     g_value_set_ulong (&value, G_MAXULONG);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXULONG);
-  }  
+    g_assert_cmpint (c, ==, G_MAXULONG);
+  }
 
   {
     gint64 c = 0;
@@ -300,8 +359,8 @@ test_copying (void)
     g_value_set_int64 (&value, G_MAXINT64);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXINT64);
-  }  
+    g_assert_cmpint (c, ==, G_MAXINT64);
+  }
 
   {
     guint64 c = 0;
@@ -311,8 +370,8 @@ test_copying (void)
     g_value_set_uint64 (&value, G_MAXUINT64);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXUINT64);
-  }  
+    g_assert_cmpint (c, ==, G_MAXUINT64);
+  }
 
   {
     gfloat c = 0;
@@ -322,8 +381,8 @@ test_copying (void)
     g_value_set_float (&value, G_MAXFLOAT);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXFLOAT);
-  }  
+    g_assert_cmpfloat (c, ==, G_MAXFLOAT);
+  }
 
   {
     gdouble c = 0;
@@ -333,8 +392,8 @@ test_copying (void)
     g_value_set_double (&value, G_MAXDOUBLE);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_MAXDOUBLE);
-  }  
+    g_assert_cmpfloat (c, ==, G_MAXDOUBLE);
+  }
 
   {
     gchar *c = NULL;
@@ -344,8 +403,9 @@ test_copying (void)
     g_value_set_string (&value, "string ?");
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (strcmp (c, "string ?") == 0);
-  }  
+    g_assert_cmpstr (c, ==, "string ?");
+    g_free (c);
+  }
 
   {
     GType c = G_TYPE_NONE;
@@ -355,20 +415,24 @@ test_copying (void)
     g_value_set_gtype (&value, G_TYPE_BOXED);
     error = lcopy (&value, &c);
     g_assert (error == NULL);
-    g_assert (c == G_TYPE_BOXED);
-  }  
+    g_assert_cmpint (c, ==, G_TYPE_BOXED);
+  }
 }
 
 
 int
-main (int argc, char *argv[])
+main (int   argc,
+      char *argv[])
 {
-  g_type_init (); 
-  
-  test_enum_transformation ();
-  test_gtype_value ();
-  test_collection ();
-  test_copying ();
-
-  return 0;
+  g_type_init ();
+
+  g_test_init (&argc, &argv, NULL);
+
+  g_test_add ("/gvalue/enum-transformation", void, NULL, NULL, test_enum_transformation, NULL);
+  g_test_add ("/gvalue/flags-transformation", void, NULL, NULL, test_flags_transformation, NULL);
+  g_test_add ("/gvalue/gtype-value", void, NULL, NULL, test_gtype_value, NULL);
+  g_test_add ("/gvalue/collection", void, NULL, NULL, test_collection, NULL);
+  g_test_add ("/gvalue/copying", void, NULL, NULL, test_copying, NULL);
+
+  return g_test_run ();
 }
