[perl-Gtk2] Test that Gtk2::Dialog's "response" signal is marshalled properly



commit 0393e6d6a230408e32a8c1757430c4233461f3d8
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Sep 19 03:03:59 2010 +0200

    Test that Gtk2::Dialog's "response" signal is marshalled properly

 t/GtkDialog.t |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/t/GtkDialog.t b/t/GtkDialog.t
index 72f54bf..76ebe06 100644
--- a/t/GtkDialog.t
+++ b/t/GtkDialog.t
@@ -9,7 +9,7 @@
 # 	- rm
 #########################
 
-use Gtk2::TestHelper tests => 29;
+use Gtk2::TestHelper tests => 33;
 
 ok( my $win = Gtk2::Window->new('toplevel') );
 
@@ -67,6 +67,23 @@ ok(1);
 $btn3->clicked;
 ok(1);
 
+# make sure that known response types are converted to strings for the reponse
+# signal of Gtk2::Dialog and its ancestors
+foreach my $package (qw/Gtk2::Dialog Gtk2::InputDialog/) {
+	my $d = $package->new;
+	my $b = $d->add_button('First Button', 'ok');
+	$d->signal_connect( response => sub {
+		is( $_[1], 'ok', "$package reponse" );
+		TRUE;
+	});
+	Glib::Idle->add( sub {
+		$b->clicked;
+		FALSE;
+	});
+	is( $d->run, 'ok', "$package run" );
+	$d->hide;
+}
+
 SKIP: {
 	skip 'set_alternative_button_order is new in 2.6', 3
 		unless Gtk2->CHECK_VERSION (2, 6, 0);



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