[perl-Gtk2/stable-1-22] Apply a better fix for the GtkTreeView test failure
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2/stable-1-22] Apply a better fix for the GtkTreeView test failure
- Date: Sun, 28 Feb 2010 13:32:11 +0000 (UTC)
commit fd31b523b0aad6a686104cd0b321a110e594c3cd
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun Feb 28 14:31:12 2010 +0100
Apply a better fix for the GtkTreeView test failure
In <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=545616>, Daniel
Leidert, with help from Kristian Rietveld, found a better fix for the
get_cursor() issue: call expand_all() prior to set_cursor() to make sure
that the targeted row is visible.
t/GtkTreeView.t | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/t/GtkTreeView.t b/t/GtkTreeView.t
index a6fe408..74fb070 100644
--- a/t/GtkTreeView.t
+++ b/t/GtkTreeView.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 121;
+use Gtk2::TestHelper tests => 123;
# $Id$
@@ -229,14 +229,10 @@ isa_ok($view -> get_background_area($path, $view_column_two), "Gtk2::Gdk::Rectan
isa_ok($view -> get_background_area(undef, $view_column_two), "Gtk2::Gdk::Rectangle");
isa_ok($view -> get_background_area($path, undef), "Gtk2::Gdk::Rectangle");
+$view -> expand_all();
$view -> set_cursor(Gtk2::TreePath -> new("1:0"), $view_column_one, 0);
-my ($cursor_path, $cursor_column) = $view -> get_cursor();
-SKIP: {
- skip 'get_cursor did not return a path', 1
- unless defined $cursor_path;
- is($cursor_path -> to_string(), "1:0");
-}
-is($cursor_column, $view_column_one);
+is(($view -> get_cursor())[0] -> to_string(), "1:0");
+is(($view -> get_cursor())[1], $view_column_one);
$view -> scroll_to_cell(Gtk2::TreePath -> new("1:1"), $view_column_one, 1, 0.5, 0.5);
$view -> scroll_to_cell(Gtk2::TreePath -> new("1:1"), $view_column_one, 0);
@@ -616,13 +612,17 @@ $view_column -> set_cell_data_func($cell_renderer, sub {
$view -> append_column($view_column);
SKIP: {
- skip("set_cursor_on_cell is new in 2.2.x", 0)
+ skip("set_cursor_on_cell is new in 2.2.x", 2)
unless Gtk2->CHECK_VERSION (2, 2, 0);
+ $view -> expand_all();
$view -> set_cursor_on_cell(Gtk2::TreePath -> new("1:1"),
$view_column,
$cell_renderer,
0);
+
+ is(($view -> get_cursor())[0] -> to_string(), "1:1");
+ is(($view -> get_cursor())[1], $view_column);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]