[gobject-introspection] Enable the utf8 tests in the everything module.



commit 1393b5abf7f4f2fb023dadb486b95daf11918112
Author: C. Scott Ananian <cscott litl com>
Date:   Fri May 1 12:00:45 2009 -0400

    Enable the utf8 tests in the everything module.
    
    We needed to tweak a couple of the tests for correctness.
---
 tests/everything/everything.c |   20 +++++++++++++++++---
 tests/everything/everything.h |    4 ++--
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/tests/everything/everything.c b/tests/everything/everything.c
index 291fc70..906a411 100644
--- a/tests/everything/everything.c
+++ b/tests/everything/everything.c
@@ -173,7 +173,6 @@ const GValue *test_value_return(int i) {
 }
 
 
-#if 0
 /************************************************************************/
 /* utf8 */
 /* insert BLACK HEART SUIT to ensure UTF-8 doesn't get mangled */
@@ -186,6 +185,7 @@ static const char utf8_nonconst[] = "nonconst \xe2\x99\xa5 utf8";
  */
 G_CONST_RETURN char *test_utf8_const_return (void)
 {
+  /* transfer mode none */
   return utf8_const;
 }
 
@@ -195,30 +195,44 @@ G_CONST_RETURN char *test_utf8_const_return (void)
  */
 char *test_utf8_nonconst_return (void)
 {
+  /* transfer mode full */
   return g_strdup (utf8_nonconst);
 }
 
 void test_utf8_nonconst_in (char *in)
 {
+  /* transfer mode full */
   g_assert (strcmp (in, utf8_nonconst) == 0);
+  g_free(in);
 }
 
 void test_utf8_const_in (const char *in)
 {
+  /* transfer mode none */
   g_assert (strcmp (in, utf8_const) == 0);
 }
 
+/**
+ * test_utf8_out:
+ * @out: (out) (transfer full):
+ */
 void test_utf8_out (char **out)
 {
+  /* out parameter, transfer mode full */
   *out = g_strdup (utf8_nonconst);
 }
 
+/**
+ * test_utf8_inout:
+ * @inout: (inout):
+ */
 void test_utf8_inout (char **inout)
 {
+  /* inout parameter, transfer mode full */
   g_assert (strcmp (*inout, utf8_const) == 0);
-  *input = g_strdup (utf8_nonconst);
+  g_free(*inout);
+  *inout = g_strdup (utf8_nonconst);
 }
-#endif
 
 /**
  * test_filename_return:
diff --git a/tests/everything/everything.h b/tests/everything/everything.h
index 2af628f..f2b470d 100644
--- a/tests/everything/everything.h
+++ b/tests/everything/everything.h
@@ -24,7 +24,7 @@ gfloat test_float (gfloat in);
 gdouble test_double (gdouble in);
 time_t test_timet (time_t in);
 GType test_gtype (GType in);
-#if 0
+
 /* utf8 */
 G_CONST_RETURN char *test_utf8_const_return (void);
 char *test_utf8_nonconst_return (void);
@@ -32,8 +32,8 @@ void test_utf8_nonconst_in (char *in);
 void test_utf8_const_in (const char *in);
 void test_utf8_out (char **out);
 void test_utf8_inout (char **inout);
-#endif
 GSList *test_filename_return (void);
+
 /* non-basic-types */
 /* array */
 gboolean test_strv_in (char **arr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]