gobject-introspection r865 - in trunk: . tests/everything
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r865 - in trunk: . tests/everything
- Date: Thu, 6 Nov 2008 23:31:19 +0000 (UTC)
Author: walters
Date: Thu Nov 6 23:31:19 2008
New Revision: 865
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=865&view=rev
Log:
Add some tests for strv
Modified:
trunk/ChangeLog
trunk/tests/everything/gitesttypes.c
trunk/tests/everything/gitesttypes.h
Modified: trunk/tests/everything/gitesttypes.c
==============================================================================
--- trunk/tests/everything/gitesttypes.c (original)
+++ trunk/tests/everything/gitesttypes.c Thu Nov 6 23:31:19 2008
@@ -142,11 +142,37 @@
/* filename? */
/* non-basic-types */
-/* array */
-/* interface */
static const char *test_sequence[] = {"1", "2", "3"};
+/* array */
+gboolean
+test_strv_in (char **arr)
+{
+ if (g_strv_length (arr) != 3)
+ return FALSE;
+ if (strcmp (arr[0], "1") != 0)
+ return FALSE;
+ if (strcmp (arr[1], "2") != 0)
+ return FALSE;
+ if (strcmp (arr[2], "3") != 0)
+ return FALSE;
+ return TRUE;
+}
+
+char **
+test_strv_out (void)
+{
+ char **ret = g_new (char *, 4);
+ ret[0] = "1";
+ ret[1] = "2";
+ ret[2] = "3";
+ ret[3] = NULL;
+ return ret;
+}
+
+/* interface */
+
/************************************************************************/
/* GList */
Modified: trunk/tests/everything/gitesttypes.h
==============================================================================
--- trunk/tests/everything/gitesttypes.h (original)
+++ trunk/tests/everything/gitesttypes.h Thu Nov 6 23:31:19 2008
@@ -35,6 +35,8 @@
/* filename? */
/* non-basic-types */
/* array */
+gboolean test_strv_in (char **arr);
+char **test_strv_out (void);
/* interface */
/* GList */
G_CONST_RETURN GList *test_glist_nothing_return (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]