[perl-Gtk3] Fix a test failure in t/zz-GdkEvent.t
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk3] Fix a test failure in t/zz-GdkEvent.t
- Date: Mon, 3 Apr 2017 13:07:33 +0000 (UTC)
commit fd1057d12dc45c7fd93b4969e261cfd46195f1c1
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Mon Apr 3 15:05:16 2017 +0200
Fix a test failure in t/zz-GdkEvent.t
Apparently, the default main loop's event queue might sometimes already
contain events even though we did not put any in there (for example, a
settings change notification). This caused test failures. To avoid
this, clear the event queue before relying on its contents.
t/zz-GdkEvent.t | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/t/zz-GdkEvent.t b/t/zz-GdkEvent.t
index 859a43b..c146df7 100644
--- a/t/zz-GdkEvent.t
+++ b/t/zz-GdkEvent.t
@@ -397,8 +397,11 @@ SKIP: {
skip 'misc. stuff; missing annotations', 4
unless Gtk3::CHECK_VERSION(3, 2, 0);
- my $event = Gtk3::Gdk::Event->new ('button-press');
+ # First, clear all pending events.
+ Gtk3::main_iteration while Gtk3::events_pending;
+ # Then add our own.
+ my $event = Gtk3::Gdk::Event->new ('button-press');
$event->put;
ok (Gtk3::Gdk::events_pending);
isa_ok (Gtk3::Gdk::Event::get (), 'Gtk3::Gdk::EventButton');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]