[perl-Gtk3] Fix a few test failures for older gtk+



commit 0b7134b97aaaf1f507347687f2b2c828536cc1c5
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Sun Feb 17 12:01:13 2013 +0100

    Fix a few test failures for older gtk+

 NEWS          |    2 ++
 lib/Gtk3.pm   |    7 ++++---
 t/overrides.t |    9 +++++++--
 3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index 93bccf1..7075d13 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 {{$NEXT}}
 
+* Fix a few test failures for older gtk+.
+
 Overview of changes in Gtk3 0.009 [2013-02-14]
 ==============================================
 
diff --git a/lib/Gtk3.pm b/lib/Gtk3.pm
index 3f2bae0..3e9cde2 100644
--- a/lib/Gtk3.pm
+++ b/lib/Gtk3.pm
@@ -1232,9 +1232,10 @@ sub Gtk3::Gdk::Window::new {
     if (exists $attr->{wmclass_name} && exists $attr->{wmclass_class}) { $attr_mask |= 'GDK_WA_WMCLASS' };
     if (exists $attr->{override_redirect}) { $attr_mask |= 'GDK_WA_NOREDIR' };
     if (exists $attr->{type_hint}) { $attr_mask |= 'GDK_WA_TYPE_HINT' };
-    if (!Gtk3::CHECK_VERSION (3, 6, 0)) {
-      # Before 3.6, the attribute mask parameter lacked proper annotations, hence
-      # we numerify it here.  FIXME: This breaks encapsulation.
+    if (!Gtk3::CHECK_VERSION (3, 4, 4)) {
+      # Before 3.4.4 or 3.5.6, the attribute mask parameter lacked proper
+      # annotations, hence we numerify it here.  FIXME: This breaks
+      # encapsulation.
       $attr_mask = $$attr_mask;
     }
   }
diff --git a/t/overrides.t b/t/overrides.t
index a09574c..e33eef2 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -499,7 +499,9 @@ __EOD__
 }
 
 # Gtk3::Gdk::Atom
-{
+SKIP: {
+  skip 'atom stuff; missing annotations', 2
+    unless Gtk3::CHECK_VERSION(3, 2, 0);
   my $atom1 = Gtk3::Gdk::Atom::intern("CLIPBOARD", Glib::FALSE);
   my $atom2 = Gtk3::Gdk::Atom::intern("CLIPBOARD", Glib::FALSE);
   my $atom3 = Gtk3::Gdk::Atom::intern("PRIMARY", Glib::FALSE);
@@ -576,13 +578,16 @@ SKIP: {
 
 # Gtk3::Gdk::Pixbuf::save, save_to_buffer, save_to_callback
 SKIP: {
+  skip 'pixbuf stuff; missing annotations', 19
+    unless Gtk3::Gdk::PIXBUF_MINOR >= 25;
+
   my ($width, $height) = (10, 5);
   my $pixbuf = Gtk3::Gdk::Pixbuf->new ('rgb', Glib::TRUE, 8, $width, $height);
   $pixbuf->fill (hex '0xFF000000');
   my $expected_pixels = $pixbuf->get_pixels;
 
   my $filename = 'testsave.png';
-  END { unlink $filename; }
+  END { unlink $filename if defined $filename; }
   eval {
     $pixbuf->save ($filename, 'png',
                    'key_arg_without_value_arg');


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