[gtk+] tests: add an unit test for the previous commits



commit 61001bc501286b2ea1677d7a11bdb1a409ddc642
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jun 7 16:41:18 2012 -0400

    tests: add an unit test for the previous commits
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677649

 gtk/tests/liststore.c |   19 +++++++++++++++++++
 gtk/tests/treestore.c |   19 +++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/gtk/tests/liststore.c b/gtk/tests/liststore.c
index 3c2cfd7..4455a13 100644
--- a/gtk/tests/liststore.c
+++ b/gtk/tests/liststore.c
@@ -455,6 +455,23 @@ list_store_test_insert_before_NULL (void)
   g_object_unref (store);
 }
 
+/* setting values */
+static void
+list_store_set_gvalue_to_transform (void)
+{
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GValue value = G_VALUE_INIT;
+
+  /* https://bugzilla.gnome.org/show_bug.cgi?id=677649 */
+  store = gtk_list_store_new (1, G_TYPE_LONG);
+  gtk_list_store_append (store, &iter);
+
+  g_value_init (&value, G_TYPE_INT);
+  g_value_set_int (&value, 42);
+  gtk_list_store_set_value (store, &iter, 0, &value);
+}
+
 /* removal */
 static void
 list_store_test_remove_begin (ListStore     *fixture,
@@ -1018,6 +1035,8 @@ register_list_store_tests (void)
 		   list_store_test_insert_before_NULL);
 
   /* setting values (FIXME) */
+  g_test_add_func ("/ListStore/set-gvalue-to-transform",
+                   list_store_set_gvalue_to_transform);
 
   /* removal */
   g_test_add ("/ListStore/remove-begin", ListStore, NULL,
diff --git a/gtk/tests/treestore.c b/gtk/tests/treestore.c
index 8940153..dee0f6d 100644
--- a/gtk/tests/treestore.c
+++ b/gtk/tests/treestore.c
@@ -456,6 +456,23 @@ tree_store_test_insert_before_NULL (void)
   g_object_unref (store);
 }
 
+/* setting values */
+static void
+tree_store_set_gvalue_to_transform (void)
+{
+  GtkTreeStore *store;
+  GtkTreeIter iter;
+  GValue value = G_VALUE_INIT;
+
+  /* https://bugzilla.gnome.org/show_bug.cgi?id=677649 */
+  store = gtk_tree_store_new (1, G_TYPE_LONG);
+  gtk_tree_store_append (store, &iter, NULL);
+
+  g_value_init (&value, G_TYPE_INT);
+  g_value_set_int (&value, 42);
+  gtk_tree_store_set_value (store, &iter, 0, &value);
+}
+
 /* removal */
 static void
 tree_store_test_remove_begin (TreeStore     *fixture,
@@ -1052,6 +1069,8 @@ register_tree_store_tests (void)
 		   tree_store_test_insert_before_NULL);
 
   /* setting values (FIXME) */
+  g_test_add_func ("/TreeStore/set-gvalue-to-transform",
+                   tree_store_set_gvalue_to_transform);
 
   /* removal */
   g_test_add ("/TreeStore/remove-begin", TreeStore, NULL,



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