[perl-Gtk2] Fix a test failure in GtkTreeView.t
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Fix a test failure in GtkTreeView.t
- Date: Sun, 28 Feb 2010 12:32:27 +0000 (UTC)
commit 4e011095987590565c4255e4a4e85353e78d78de
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun Feb 28 13:30:06 2010 +0100
Fix a test failure in GtkTreeView.t
Check the path returned by get_cursor() for definedness before using it.
Fixes RT #54045.
t/GtkTreeView.t | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/t/GtkTreeView.t b/t/GtkTreeView.t
index 02d57db..a6fe408 100644
--- a/t/GtkTreeView.t
+++ b/t/GtkTreeView.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 123;
+use Gtk2::TestHelper tests => 121;
# $Id$
@@ -230,8 +230,13 @@ isa_ok($view -> get_background_area(undef, $view_column_two), "Gtk2::Gdk::Rectan
isa_ok($view -> get_background_area($path, undef), "Gtk2::Gdk::Rectangle");
$view -> set_cursor(Gtk2::TreePath -> new("1:0"), $view_column_one, 0);
-is(($view -> get_cursor())[0] -> to_string(), "1:0");
-is(($view -> get_cursor())[1], $view_column_one);
+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);
$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);
@@ -611,16 +616,13 @@ $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", 2)
+ skip("set_cursor_on_cell is new in 2.2.x", 0)
unless Gtk2->CHECK_VERSION (2, 2, 0);
$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]