summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@litl.com>2009-05-01 12:00:45 -0400
committerJohan Bilien <jobi@litl.com>2009-05-12 16:04:09 +0100
commit1393b5abf7f4f2fb023dadb486b95daf11918112 (patch)
tree4f004086d62c9a71773ee42a71fd38868ccfa191 /tests
parent2fe114c880585f475c757277c4b7f0e78a5eb27e (diff)
downloadgobject-introspection-1393b5abf7f4f2fb023dadb486b95daf11918112.tar.gz
Enable the utf8 tests in the everything module.
We needed to tweak a couple of the tests for correctness.
Diffstat (limited to 'tests')
-rw-r--r--tests/everything/everything.c20
-rw-r--r--tests/everything/everything.h4
2 files changed, 19 insertions, 5 deletions
diff --git a/tests/everything/everything.c b/tests/everything/everything.c
index 291fc704..906a4114 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 2af628f0..f2b470d8 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);