[perl-Gtk2] Test Glib::ParamSpec->value_validate on a Gtk2::Gdk::Region
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Test Glib::ParamSpec->value_validate on a Gtk2::Gdk::Region
- Date: Sun, 12 Dec 2010 14:15:49 +0000 (UTC)
commit 7556cebcf059617adfee459b958b310a839a3e84
Author: Kevin Ryde <user42 zip com au>
Date: Sun Dec 12 15:14:21 2010 +0100
Test Glib::ParamSpec->value_validate on a Gtk2::Gdk::Region
This tests that the recent change to Glib
(7b3d380d9b98e45a8a32fab3098ec7e64f60ad2f) actually works.
https://bugzilla.gnome.org/show_bug.cgi?id=635809
t/GdkRegion.t | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/t/GdkRegion.t b/t/GdkRegion.t
index dae8c15..b22838b 100644
--- a/t/GdkRegion.t
+++ b/t/GdkRegion.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 30, noinit => 1;
+use Gtk2::TestHelper tests => 35, noinit => 1;
# $Id$
@@ -10,6 +10,20 @@ my $rectangle_two = Gtk2::Gdk::Rectangle -> new(23, 42, 15, 15);
isa_ok($rectangle_one -> intersect($rectangle_two), "Gtk2::Gdk::Rectangle");
isa_ok($rectangle_one -> union($rectangle_two), "Gtk2::Gdk::Rectangle");
+{
+ my $pspec = Glib::ParamSpec->boxed ('bb','bb','blurb',
+ 'Gtk2::Gdk::Rectangle',
+ Glib::G_PARAM_READWRITE);
+ my $rect = Gtk2::Gdk::Rectangle->new (1,2,3,4);
+ my ($flag, $new) = $pspec->value_validate($rect);
+ undef $rect;
+ ok (! $flag, 'value_validate() rectangle unchanged');
+ is ($new->x, 1, );
+ is ($new->y, 2);
+ is ($new->width, 3);
+ is ($new->height, 4);
+}
+
my $region = Gtk2::Gdk::Region -> new();
isa_ok($region, "Gtk2::Gdk::Region");
ok($region -> empty());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]