[perl-Glib-Object-Introspection] Add tests for floating objects
- From: Torsten SchÃnfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Glib-Object-Introspection] Add tests for floating objects
- Date: Wed, 10 Aug 2011 13:32:09 +0000 (UTC)
commit 4e7003d20ec63e27de8590d1025befdabbefecb8
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date: Wed Aug 10 15:30:05 2011 +0200
Add tests for floating objects
t/objects.t | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/t/objects.t b/t/objects.t
index 3f36c6a..bee8a2a 100644
--- a/t/objects.t
+++ b/t/objects.t
@@ -4,8 +4,9 @@ BEGIN { require './t/inc/setup.pl' };
use strict;
use warnings;
+use Scalar::Util qw/weaken/;
-plan tests => 36;
+plan tests => 41;
my $obj = TestObj->constructor;
isa_ok ($obj, 'TestObj');
@@ -15,6 +16,9 @@ $obj = TestObj->new ($obj);
isa_ok ($obj, 'TestObj');
isa_ok ($obj, 'Glib::Object');
+weaken $obj;
+is ($obj, undef);
+
$obj = TestObj->new_from_file ($0);
isa_ok ($obj, 'TestObj');
isa_ok ($obj, 'Glib::Object');
@@ -82,3 +86,12 @@ isa_ok ($wi, 'Glib::Object');
$wi->set_testbool (1);
ok ($wi->get_testbool);
is (TestWi8021x::static_method (23), 46);
+
+# floating objects
+my $fl = TestFloating->new;
+isa_ok ($fl, 'TestFloating');
+isa_ok ($fl, 'Glib::InitiallyUnowned');
+isa_ok ($fl, 'Glib::Object');
+
+weaken $fl;
+is ($fl, undef);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]