summaryrefslogtreecommitdiff
path: root/gtk/tests
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2010-10-14 11:24:46 +0200
committerKristian Rietveld <kris@gtk.org>2010-10-14 16:47:00 +0200
commite774e235d776cd9dcb22019b9ccc6e7e1805f0f7 (patch)
treecbe4d76d4720613522110980c60f4f09f4dd9d4b /gtk/tests
parent359818d6b7bcb3c77412cee3e1c2e404312eb002 (diff)
downloadgtk+-e774e235d776cd9dcb22019b9ccc6e7e1805f0f7.tar.gz
Add unit test for bug 93584
Diffstat (limited to 'gtk/tests')
-rw-r--r--gtk/tests/treeview-scrolling.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gtk/tests/treeview-scrolling.c b/gtk/tests/treeview-scrolling.c
index f29770ef8e..36ade41f37 100644
--- a/gtk/tests/treeview-scrolling.c
+++ b/gtk/tests/treeview-scrolling.c
@@ -995,6 +995,42 @@ test_bug359231 (void)
scroll_fixture_teardown (fixture, NULL);
}
+/* Test for GNOME bugzilla bug 93584. We add 150 rows to an existing
+ * small model, and scroll to one of these with alignment.
+ */
+static void
+test_bug93584 (ScrollFixture *fixture,
+ gconstpointer test_data)
+{
+ int row, i;
+ GtkTreeStore *store;
+ GtkTreePath *path;
+
+ g_test_bug ("93584");
+
+ /* Mimic state as in original test case */
+ g_signal_connect (G_OBJECT (fixture->tree_view), "realize",
+ G_CALLBACK (gtk_tree_view_expand_all), NULL);
+ gtk_widget_show_all (fixture->window);
+
+ store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fixture->tree_view)));
+
+ /* Add 150 rows */
+ for (i = 0; i < 150; i++) {
+ GtkTreeIter iter;
+
+ gtk_tree_store_append (store, &iter, NULL);
+ gtk_tree_store_set (store, &iter, 0, "Row", -1);
+ }
+
+ row = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL);
+ row -= 20;
+
+ path = gtk_tree_path_new_from_indices (row, -1);
+ scroll (fixture, path, TRUE, 0.5);
+ gtk_tree_path_free (path);
+}
+
/* Infrastructure for automatically adding tests */
enum
{
@@ -1274,6 +1310,10 @@ main (int argc, char **argv)
scroll_fixture_teardown);
g_test_add_func ("/TreeView/scrolling/specific/bug-359231",
test_bug359231);
+ g_test_add ("/TreeView/scrolling/specific/bug-93584",
+ ScrollFixture, NULL,
+ scroll_fixture_tree_setup, test_bug93584,
+ scroll_fixture_teardown);
return g_test_run ();
}