[perl-Gtk3] Enable more Gtk3::Gdk::Event tests
- From: Torsten SchÃnfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk3] Enable more Gtk3::Gdk::Event tests
- Date: Sat, 11 Aug 2012 18:40:40 +0000 (UTC)
commit 07876a9fdd0b4abc29e246ec1750c6ac4a5711fe
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date: Sat Aug 11 20:38:28 2012 +0200
Enable more Gtk3::Gdk::Event tests
Using the recently extended field writing support in G:O:I.
dist.ini | 2 +-
t/zz-GdkEvent.t | 38 +++++++++++++++++++++++---------------
2 files changed, 24 insertions(+), 16 deletions(-)
---
diff --git a/dist.ini b/dist.ini
index 522c740..4c8a974 100644
--- a/dist.ini
+++ b/dist.ini
@@ -17,7 +17,7 @@ copyright_year = 2011
[Prereqs]
Glib = 1.260 ; FIXME: 1.270
Cairo::GObject = 1.000
-Glib::Object::Introspection = 0.009 ; FIXME: 0.011
+Glib::Object::Introspection = 0.011 ; FIXME: 0.012
[NextRelease]
filename = NEWS
diff --git a/t/zz-GdkEvent.t b/t/zz-GdkEvent.t
index 3340d2e..a16b023 100644
--- a/t/zz-GdkEvent.t
+++ b/t/zz-GdkEvent.t
@@ -7,7 +7,7 @@ BEGIN { require './t/inc/setup.pl' }
use strict;
use warnings;
-plan tests => 134;
+plan tests => 144;
sub fields_ok {
my ($event, %fields_values) = @_;
@@ -57,18 +57,18 @@ is ($event->get_source_device, $device, '$event->get_source_device');
isa_ok ($event = Gtk3::Gdk::Event->new ('expose'),
'Gtk3::Gdk::EventExpose', 'Gtk3::Gdk::Event->new expose');
+field_ok ($event, count => 10);
+
my $rect = {x => 0, y => 0, width => 100, height => 100}; # FIXME: [0, 0, 100, 100]
$event->area ($rect);
is_deeply ($event->area, $rect, '$expose_event->area');
-# FIXME: $event->region not accessible currently
-# my $region = Cairo::Region->create ($rect);
-# $event->region ($region);
-# isa_ok ($event->region, 'Cairo::Region', '$expose_event->region');
-# $event->region (undef);
-# is ($event->region, undef, '$expose_event->region');
-
-field_ok ($event, count => 10);
+my $region = Cairo::Region->create ($rect);
+$event->region ($region);
+isa_ok ($event->region, 'Cairo::Region', '$expose_event->region');
+is_deeply ($event->region->get_rectangle (0), $rect);
+$event->region (undef);
+is ($event->region, undef, '$expose_event->region undef');
# Visibility ###################################################################
@@ -231,10 +231,12 @@ isa_ok ($event = Gtk3::Gdk::Event->new ('property-notify'),
fields_ok ($event, time => 42);
-# FIXME: $event->atom not accessible currently
-# my $atom = Gtk3::Gdk::Atom::intern ('foo', Glib::FALSE);
-# $event->atom ($atom);
-# isa_ok ($event->atom, 'Gtk3::Gdk::Atom', '$property_event->atom');
+my $atom = Gtk3::Gdk::Atom::intern ('foo', Glib::FALSE);
+$event->atom ($atom);
+isa_ok ($event->atom, 'Gtk3::Gdk::Atom', '$property_event->atom');
+is ($event->atom->name, $atom->name, '$property_event->atom');
+$event->atom (undef);
+is ($event->atom, undef);
SKIP: {
# <https://bugzilla.gnome.org/show_bug.cgi?id=677775>
@@ -290,7 +292,12 @@ isa_ok ($event = Gtk3::Gdk::Event->new ('selection-clear'),
fields_ok ($event, time => 42);
-# FIXME: $event->selection, target, property not accessible currently
+$event->property ($atom);
+is ($event->property->name, $atom->name);
+$event->selection ($atom);
+is ($event->selection->name, $atom->name);
+$event->target ($atom);
+is ($event->target->name, $atom->name);
field_ok ($event, requestor => $window);
field_ok ($event, requestor => undef);
@@ -307,7 +314,8 @@ fields_ok ($event, reason => 'destroy',
field_ok ($event, owner => $window);
field_ok ($event, owner => undef);
-# FIXME: $event->selection not accessible currently
+$event->selection ($atom);
+is ($event->selection->name, $atom->name);
# GrabBroken ##################################################################
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]