[perl-Gtk3] Test that giving undef for a callback works



commit 7ec60ac8979e714597992524be5c2b95fe39da95
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Sun May 13 13:10:53 2012 +0200

    Test that giving undef for a callback works
    
    Specifically, test that it does not yield an invalid invocation of a destroy
    notify func.

 dist.ini      |    4 ++--
 t/overrides.t |   26 +++++++++++++++++---------
 2 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/dist.ini b/dist.ini
index d751d62..79e7362 100644
--- a/dist.ini
+++ b/dist.ini
@@ -15,9 +15,9 @@ copyright_year = 2011
 [PkgVersion]
 
 [Prereqs]
-Glib = 1.253 # FIXME: 1.260
+Glib = 1.253 ; FIXME: 1.260
 Cairo::GObject = 1.000
-Glib::Object::Introspection = 0.002
+Glib::Object::Introspection = 0.008 ; FIXME: 0.009 for the callback fix
 
 [NextRelease]
 filename = NEWS
diff --git a/t/overrides.t b/t/overrides.t
index d8bd01c..70bb798 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -56,15 +56,23 @@ SKIP: {
 
 # Gtk3::Menu::popup and popup_for_device
 {
-  my $menu = Gtk3::Menu->new;
-  my $position_callback = sub {
-    my ($menu, $data) = @_;
-    isa_ok ($menu, "Gtk3::Menu");
-    return @$data;
-  };
-  $menu->popup (undef, undef, undef, undef, 1, 0);
-  $menu->popup (undef, undef, $position_callback, [50, 50], 1, 0);
-  $menu->popup_for_device (undef, undef, undef, $position_callback, [50, 50, Glib::TRUE], 1, 0);
+  {
+    my $menu = Gtk3::Menu->new;
+    my $position_callback = sub {
+      my ($menu, $data) = @_;
+      isa_ok ($menu, "Gtk3::Menu");
+      return @$data;
+    };
+    $menu->popup (undef, undef, $position_callback, [50, 50], 1, 0);
+    $menu->popup_for_device (undef, undef, undef, $position_callback, [50, 50, Glib::TRUE], 1, 0);
+  }
+
+  # Test this separately to ensure that specifying no callback does not lead to
+  # an invalid invocation of the destroy notify func.
+  {
+    my $menu = Gtk3::Menu->new;
+    $menu->popup (undef, undef, undef, undef, 1, 0);
+  }
 }
 
 # Gtk3::Stock



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