Hello community, here is the log from the commit of package perl-Glib checked in at Tue Dec 12 23:23:07 CET 2006. -------- --- perl-Glib/perl-Glib.changes 2006-09-11 11:00:26.000000000 +0200 +++ /mounts/work_src_done/STABLE/perl-Glib/perl-Glib.changes 2006-12-12 13:54:17.000000000 +0100 @@ -1,0 +2,9 @@ +Tue Dec 12 13:10:09 CET 2006 - anicka@suse.cz + +- update to 1.142 + * bugfixes, test fixes + * GType.xs: Add macros, PORTABLE_STRTOLL and PORTABLE_STRTOULL, + to centralize the preprocessor madness for 64bit integer + support. + +------------------------------------------------------------------- Old: ---- Glib-1.140.tar.bz2 New: ---- Glib-1.142.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Glib.spec ++++++ --- /var/tmp/diff_new_pack.H5O9Qr/_old 2006-12-12 23:23:01.000000000 +0100 +++ /var/tmp/diff_new_pack.H5O9Qr/_new 2006-12-12 23:23:01.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package perl-Glib (Version 1.140) +# spec file for package perl-Glib (Version 1.142) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,12 +12,12 @@ Name: perl-Glib BuildRequires: glib2-devel perl-ExtUtils-Depends perl-ExtUtils-PkgConfig -Version: 1.140 +Version: 1.142 Release: 1 Requires: perl = %{perl_version} Autoreqprov: on Group: Development/Libraries/Perl -License: LGPL +License: GNU Library General Public License v. 2.0 and 2.1 (LGPL) URL: http://cpan.org/modules/by-module/Glib/ Summary: Glib Perl module Source: Glib-%{version}.tar.bz2 @@ -69,6 +69,12 @@ /var/adm/perl-modules/%{name} %changelog -n perl-Glib +* Tue Dec 12 2006 - anicka@suse.cz +- update to 1.142 + * bugfixes, test fixes + * GType.xs: Add macros, PORTABLE_STRTOLL and PORTABLE_STRTOULL, + to centralize the preprocessor madness for 64bit integer + support. * Thu Sep 07 2006 - anicka@suse.cz - update to 1.140 * bugfixes and fixes in tests ++++++ Glib-1.140.tar.bz2 -> Glib-1.142.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/AUTHORS new/Glib-1.142/AUTHORS --- old/Glib-1.140/AUTHORS 2006-06-22 20:04:47.000000000 +0200 +++ new/Glib-1.142/AUTHORS 2006-11-23 19:44:06.000000000 +0100 @@ -22,6 +22,8 @@ Steven Walter stevenrwalter at gmail dot com Aristotle Pagaltzis pagaltzis at gmx dot de Wim Lewis wiml at users dot sourceforge dot net +Michael G Schwern schwern at gmail dot com +Serguei Trouchelle STRO at cpan dot org several important bits of gtk2-perl were heavily inspired by pygtk, gtk-perl, and a good read-through of the gtk+ source code, so credit goes to those guys diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/ChangeLog new/Glib-1.142/ChangeLog --- old/Glib-1.140/ChangeLog 2006-09-04 20:04:30.000000000 +0200 +++ new/Glib-1.142/ChangeLog 2006-12-04 20:46:46.000000000 +0100 @@ -1,3 +1,59 @@ +2006-12-04 kaffeetisch + + * Glib.pm, NEWS, README: Stable release 1.142. + +2006-11-23 kaffeetisch + + Merge from HEAD: + + * GType.xs, gperl.h: Revert the G_OS_WIN32 change and just use + WIN32 instead. G_OS_WIN32 doesn't seem to be defined on most + win32 boxes. + + * AUTHORS, GType.xs: Use _strtoi64 and and _strtoui64 on win32 if + compiling with MSVC; patch from Serguei Trouchelle. + +2006-11-19 kaffeetisch + + * Glib.pm, NEWS, README: Stable release 1.141. + +2006-11-19 kaffeetisch + + Merge from HEAD: + + * GBookmarkFile.xs: Remove a custom "=for signature" directive + that incorrectly specified a boolean return value for remove_item. + + * GType.xs, gperl.h: Use G_OS_WIN32 instead of WIN32 or _WIN32. + +2006-10-03 kaffeetisch + + * CodeGen.pm, GenPod.pm, ParseXSDoc.pm: Fix POD errors. (Mainly + =cut's not followed by a blank line.) + +2006-09-13 kaffeetisch + + * GBoxed.xs (gperl_new_boxed_copy): Check for NULL before passing + the boxed pointer to g_boxed_copy. + + * GType.xs: Add macros, PORTABLE_STRTOLL and PORTABLE_STRTOULL, to + centralize the preprocessor madness for 64bit integer support. On + win32, which apparently lacks strtoll or similar, use strtol and + strtoul for now to make it at least compile. + + * t/7.t: Apply a patch from Michael G Schwern that introduces + helper functions which make this complicated test easier to read. + + * t/filename.t: Remove two debug prints that were causing perl + warnings. + +2006-09-09 kaffeetisch + + * t/4.t, t/5.t, t/6.t, t/7.t, t/9.t: In hand-rolled test output, + use '-' instead of '#' as the comment designator. In TAP (Test + Anything Protocol), the protocol we use, '#' is for directives and + '-' is for comments. + 2006-09-04 kaffeetisch * Glib.pm, Makefile.PL, NEWS, README: Stable release 1.140. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/CodeGen.pm new/Glib-1.142/CodeGen.pm --- old/Glib-1.140/CodeGen.pm 2005-07-27 03:59:11.000000000 +0200 +++ new/Glib-1.142/CodeGen.pm 2006-10-17 21:56:32.000000000 +0200 @@ -156,6 +156,7 @@ out with leading # marks if you want to hide it from C<write_boot>. =cut + sub write_boot { my $class = shift; my %opts = ( @@ -254,8 +255,9 @@ class name should be mapped, e.g., Gtk2::Gdk::Pixbuf::Error. -=cut +=back +=cut # when we parse the maps, type handlers will call several helper functions # to add header lines, typemaps, and boot lines. we store those here. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/GBookmarkFile.xs new/Glib-1.142/GBookmarkFile.xs --- old/Glib-1.140/GBookmarkFile.xs 2006-06-20 19:17:21.000000000 +0200 +++ new/Glib-1.142/GBookmarkFile.xs 2006-11-19 20:23:38.000000000 +0100 @@ -32,7 +32,7 @@ /* wrap it, bless it, ship it. */ sv = newRV_noinc ((SV *) bookmark); - + stash = gv_stashpv ("Glib::BookmarkFile", TRUE); sv_bless (sv, stash); @@ -68,7 +68,7 @@ if ($b->has_item($uri)) { $title = $b->get_title($uri); $desc = $b->get_description($uri); - + print "Bookmark for `$uri' ($title):\n"; print " $desc\n"; } @@ -78,8 +78,7 @@ <?xml version="1.0" encoding="UTF-8"?> <xbel version="1.0" xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks" - xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info" -> + xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"> <bookmark href="file:///tmp/test-file.txt" added="2006-03-22T18:54:00Z" modified="2006-03-22T18:54:00Z" visited="2006-03-22T18:54:00Z"> <title>Test File</title> <desc>Some test file</desc> @@ -93,7 +92,7 @@ </info> </bookmark> </xbel> - + =for position DESCRIPTION =head1 DESCRIPTION @@ -220,7 +219,6 @@ g_bookmark_file_has_item (GBookmarkFile *bookmark_file, const gchar *uri) =for apidoc __gerror__ -=signature boolean = $bookmark_file->remove_item ($uri) Removes the bookmark for $uri from the bookmark file. =cut void diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/GBoxed.xs new/Glib-1.142/GBoxed.xs --- old/Glib-1.140/GBoxed.xs 2005-03-24 10:23:38.000000000 +0100 +++ new/Glib-1.142/GBoxed.xs 2006-10-17 21:56:32.000000000 +0200 @@ -16,7 +16,7 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. * - * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GBoxed.xs,v 1.23 2005/03/24 09:23:38 kaffeetisch Exp $ + * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GBoxed.xs,v 1.24 2006/09/13 14:53:27 kaffeetisch Exp $ */ =head2 GBoxed @@ -444,7 +444,9 @@ gperl_new_boxed_copy (gpointer boxed, GType gtype) { - return gperl_new_boxed (g_boxed_copy (gtype, boxed), gtype, TRUE); + return boxed + ? gperl_new_boxed (g_boxed_copy (gtype, boxed), gtype, TRUE) + : &PL_sv_undef; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/GType.xs new/Glib-1.142/GType.xs --- old/Glib-1.140/GType.xs 2006-09-04 17:20:43.000000000 +0200 +++ new/Glib-1.142/GType.xs 2006-11-23 19:45:21.000000000 +0100 @@ -16,7 +16,7 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. * - * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GType.xs,v 1.74 2006/03/04 17:17:31 kaffeetisch Exp $ + * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GType.xs,v 1.75.2.2 2006/11/23 18:45:21 kaffeetisch Exp $ */ =head2 GType / GEnum / GFlags @@ -690,13 +690,27 @@ =cut +#ifdef _MSC_VER +# include <stdlib.h> +#endif + +#ifdef WIN32 +# ifdef _MSC_VER +# define PORTABLE_STRTOLL(str, end, base) _strtoi64 (str, end, base) +# else +# define PORTABLE_STRTOLL(str, end, base) strtol (str, end, base) +# endif +#else +# define PORTABLE_STRTOLL(str, end, base) strtoll (str, end, base) +#endif + gint64 SvGInt64 (SV *sv) { #ifdef USE_64_BIT_ALL return SvIV (sv); #else - return strtoll (SvPV_nolen (sv), NULL, 10); + return PORTABLE_STRTOLL (SvPV_nolen (sv), NULL, 10); #endif } @@ -732,13 +746,23 @@ =cut +#ifdef WIN32 +# ifdef _MSC_VER +# define PORTABLE_STRTOULL(str, end, base) _strtoui64 (str, end, base) +# else +# define PORTABLE_STRTOULL(str, end, base) strtoul (str, end, base) +# endif +#else +# define PORTABLE_STRTOULL(str, end, base) strtoull (str, end, base) +#endif + guint64 SvGUInt64 (SV *sv) { #ifdef USE_64_BIT_ALL return SvUV (sv); #else - return strtoull (SvPV_nolen (sv), NULL, 10); + return PORTABLE_STRTOULL (SvPV_nolen (sv), NULL, 10); #endif } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/GenPod.pm new/Glib-1.142/GenPod.pm --- old/Glib-1.140/GenPod.pm 2005-06-28 21:46:14.000000000 +0200 +++ new/Glib-1.142/GenPod.pm 2006-10-17 21:56:32.000000000 +0200 @@ -203,6 +203,7 @@ this function's code as a starting point for your own pretty-printer. =cut + sub xsdoc2pod { my $datafile = shift(); @@ -427,6 +428,7 @@ and the _ornull variant is handled for you. =cut + sub add_types { my @files = @_; foreach my $f (@files) { @@ -457,6 +459,7 @@ are no properties or I<$package> is not a Glib::Object. =cut + sub podify_properties { my $package = shift; my @properties; @@ -490,6 +493,7 @@ enum or flags type. =cut + sub podify_values { my $package = shift; my @values; @@ -508,6 +512,7 @@ I<$packagename> is not a Glib::Object derivative. =cut + sub podify_signals { my $str = undef; eval { @@ -687,6 +692,7 @@ =back =cut + sub podify_pods { my $pods = shift; @@ -724,6 +730,7 @@ registered GType. =cut + sub podify_ancestors { my @anc; eval { @anc = Glib::Type->list_ancestors (shift); 1; }; @@ -748,6 +755,7 @@ Returns the text as a string, or undef if the type implements no interfaces. =cut + sub podify_interfaces { my @int; eval { @int = Glib::Type->list_interfaces (shift); 1; }; @@ -764,6 +772,7 @@ I<$packagename>. =cut + sub podify_methods { my $package = shift; @@ -959,6 +968,7 @@ be found, this just returns the input string. =cut + sub convert_type { my $typestr = shift; @@ -1019,6 +1029,7 @@ switches in the description pod (arg and signature overrides). =cut + sub xsub_to_pod { my $xsub = shift; my $sigprefix = shift || ''; @@ -1139,6 +1150,7 @@ xsub. =cut + sub compile_signature { my $xsub = shift; @@ -1200,6 +1212,7 @@ Prepend a $ to anything that's not the literal ellipsis string '...'. =cut + sub fixup_arg_name { my $name = shift; my $sigil = $name eq '...' ? '' : '$'; @@ -1212,6 +1225,7 @@ does NULL => undef. =cut + sub fixup_default { my $value = shift; return (defined ($value) @@ -1224,6 +1238,7 @@ C type to Perl type conversion for argument types. =cut + sub convert_arg_type { convert_type (@_) } @@ -1232,6 +1247,7 @@ C type to Perl type conversion suitable for return types. =cut + sub convert_return_type_to_name { my $type = convert_type (@_); if ($type =~ s/^.*:://) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/Glib.pm new/Glib-1.142/Glib.pm --- old/Glib-1.140/Glib.pm 2006-09-04 20:04:37.000000000 +0200 +++ new/Glib-1.142/Glib.pm 2006-12-04 20:46:56.000000000 +0100 @@ -15,7 +15,7 @@ # along with this library; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. # -# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/Glib.pm,v 1.107 2006/09/04 18:04:37 kaffeetisch Exp $ +# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/Glib.pm,v 1.107.2.2 2006/12/04 19:46:56 kaffeetisch Exp $ # package Glib; @@ -63,7 +63,7 @@ our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{all} = \@EXPORT_OK; -our $VERSION = '1.140'; +our $VERSION = '1.142'; sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/META.yml new/Glib-1.142/META.yml --- old/Glib-1.140/META.yml 2006-09-04 20:05:03.000000000 +0200 +++ new/Glib-1.142/META.yml 2006-12-04 20:47:41.000000000 +0100 @@ -1,12 +1,13 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: Glib -version: 1.140 -version_from: Glib.pm -installdirs: site -requires: +--- #YAML:1.0 +name: Glib +version: 1.142 +abstract: Perl wrappers for the GLib utility and Object libraries +license: ~ +generated_by: ExtUtils::MakeMaker version 6.31 +distribution_type: module +requires: ExtUtils::Depends: 0.200 ExtUtils::PkgConfig: 1.00 - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.2.html + version: 1.2 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/NEWS new/Glib-1.142/NEWS --- old/Glib-1.140/NEWS 2006-09-04 20:03:38.000000000 +0200 +++ new/Glib-1.142/NEWS 2006-12-04 20:46:17.000000000 +0100 @@ -1,3 +1,18 @@ +Overview of changes in Glib 1.142 +================================= + +* Switch back to WIN32 instead of G_OS_WIN32 to avoid compilation problems. + [Torsten] +* Use _strtoi64 and _strtoui64 on Win32 for large integer conversion. + [Serguei Trouchelle] + +Overview of changes in Glib 1.141 +================================= + +* Fix a compilation problem on Win32. [Torsten] +* Fix some POD errors. [Torsten] +* Fix a few test suite issues. [Torsten] + Overview of changes in Glib 1.140 ================================= diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/ParseXSDoc.pm new/Glib-1.142/ParseXSDoc.pm --- old/Glib-1.140/ParseXSDoc.pm 2006-02-11 18:36:40.000000000 +0100 +++ new/Glib-1.142/ParseXSDoc.pm 2006-10-17 21:56:32.000000000 +0200 @@ -134,6 +134,7 @@ Create a new xsub parser. =cut + sub new { my $class = shift; return bless { @@ -153,6 +154,7 @@ if the parser hasn't reached the first MODULE line. =cut + sub package { my $self = shift; return ($self->{package} || $self->{module}) @@ -166,6 +168,7 @@ are permanent and useful. =cut + sub pkgdata { my $self = shift; my $pkg = $self->{object} || $self->package; @@ -184,6 +187,7 @@ data structures. =cut + sub parse_file { my $self = shift; my $filename = shift; @@ -358,6 +362,7 @@ Match C<=for apidoc> pods to xsubs. =cut + sub swizzle_pods { my $self = shift; foreach my $package (keys %{$self->{data}}) { @@ -395,6 +400,7 @@ =for apidoc __function__ for functions rather than methods =cut + sub preprocess_pods { my $self = shift; foreach my $package (keys %{$self->{data}}) { @@ -433,6 +439,7 @@ accordingly. =cut + sub is_module_line { my $self = shift; my $l = shift; @@ -459,6 +466,7 @@ that first line to be included. =cut + sub slurp_pod_paragraph { my $parser = shift; my $firstline = shift; @@ -507,6 +515,7 @@ of strings. =cut + sub parse_xsub { my ($self, @thisxsub) = @_; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/README new/Glib-1.142/README --- old/Glib-1.140/README 2006-09-04 20:04:37.000000000 +0200 +++ new/Glib-1.142/README 2006-12-04 20:46:56.000000000 +0100 @@ -1,4 +1,4 @@ -Glib version 1.140 +Glib version 1.142 ================== This module provides perl access to Glib and GLib's GObject libraries. @@ -102,4 +102,4 @@ with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. -# $Id: README,v 1.70 2006/09/04 18:04:37 kaffeetisch Exp $ +# $Id: README,v 1.70.2.2 2006/12/04 19:46:56 kaffeetisch Exp $ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/gperl.h new/Glib-1.142/gperl.h --- old/Glib-1.140/gperl.h 2006-08-06 21:30:55.000000000 +0200 +++ new/Glib-1.142/gperl.h 2006-11-23 19:45:21.000000000 +0100 @@ -16,7 +16,7 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. * - * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v 1.44 2006/07/23 10:21:00 kaffeetisch Exp $ + * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v 1.44.2.2 2006/11/23 18:45:21 kaffeetisch Exp $ */ #ifndef _GPERL_H_ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/4.t new/Glib-1.142/t/4.t --- old/Glib-1.140/t/4.t 2006-07-20 19:45:53.000000000 +0200 +++ new/Glib-1.142/t/4.t 2006-10-17 21:56:32.000000000 +0200 @@ -87,8 +87,8 @@ my @fooprops = Foo->list_properties; my @barprops = Bar->list_properties; -print "".(@fooprops == 1 ? "ok 14" : "not ok")." # property count for parent\n"; -print "".(@barprops == 2 ? "ok 15" : "not ok")." # property count for child\n"; +print "".(@fooprops == 1 ? "ok 14" : "not ok")." - property count for parent\n"; +print "".(@barprops == 2 ? "ok 15" : "not ok")." - property count for child\n"; __END__ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/5.t new/Glib-1.142/t/5.t --- old/Glib-1.140/t/5.t 2004-05-05 00:11:24.000000000 +0200 +++ new/Glib-1.142/t/5.t 2006-10-17 21:56:32.000000000 +0200 @@ -64,7 +64,7 @@ $my = new MyClass some_string => "foo", invalid_param => 1, some_string => "bar"; - print "not ok # should not get here\n"; + print "not ok - should not get here\n"; }; #print "\$@ = '$@'\n"; print ($@ !~ /does not support property/ ? "not " : "", "ok 5\n"); @@ -72,7 +72,7 @@ $my->set (some_string => "foo", invalid_param => 1, some_string => "bar"); - print "not ok # should not get here\n"; + print "not ok - should not get here\n"; }; #print "\$@ = '$@'\n"; print ($@ !~ /does not support property/ ? "not " : "", "ok 6\n"); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/6.t new/Glib-1.142/t/6.t --- old/Glib-1.140/t/6.t 2004-05-05 00:11:24.000000000 +0200 +++ new/Glib-1.142/t/6.t 2006-10-17 21:56:32.000000000 +0200 @@ -43,7 +43,7 @@ my $ary = \@{"$_[0]\_ok"}; my $seq = $ary->[0]; shift @$ary; - print "".($condition ? "ok" : "not ok")." $seq # $_[0]\n"; + print "".($condition ? "ok" : "not ok")." $seq - $_[0]\n"; } sub readwrite { [qw/readable writable/] } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/7.t new/Glib-1.142/t/7.t --- old/Glib-1.140/t/7.t 2006-08-06 21:29:25.000000000 +0200 +++ new/Glib-1.142/t/7.t 2006-10-17 21:56:32.000000000 +0200 @@ -19,11 +19,36 @@ =cut +use Test::More import => ['diag']; + print "1..34\n"; +sub ok($$;$) { + my($test, $num, $name) = @_; + + my $out = $test ? "ok" : "not ok"; + $out .= " $num" if $num; + $out .= " - $name" if defined $name; + + print "$out\n"; + + return $test; +} + +sub pass($;$) { + my($num, $name) = @_; + return ok(1, $num, $name); +} + +sub fail(;$) { + my($name) = @_; + return ok(0, 0, $name); +} + + use Glib; -print "ok 1\n"; +pass(1, 'Glib compiled'); package MyClass; @@ -53,7 +78,7 @@ # more complicated/sophisticated value returner list_returner => { class_closure => sub { - print "ok 32 # hello from the class closure\n"; + ::pass(32, "hello from the class closure"); -1 }, flags => 'run-last', @@ -101,7 +126,7 @@ } sub do_returner { - print "ok 24\n"; + ::pass(24); -1.5; } @@ -117,16 +142,14 @@ my $b = 0; sub func_a { - print 0==$a++ - ? "ok 4 # func_a\n" - : "not ok # func_a called after being removed\n"; + ok(0==$a++, 4, "func_a"); } sub func_b { if (0==$b++) { - print "ok 5 # func_b\n"; + pass(5, "func_b"); $_[0]->signal_handlers_disconnect_by_func (\&func_a); } else { - print "ok 7 # func_b again\n"; + pass(7, "func_b again"); } $_[0]->signal_stop_emission_by_name("something_changed"); @@ -134,19 +157,19 @@ { my $my = new MyClass; - print "ok 2 # instantiated MyClass\n"; + pass(2, "instantiated MyClass"); $my->signal_connect (something_changed => \&func_a); my $id_b = $my->signal_connect (something_changed => \&func_b); - print "ok 3 # connected handlers\n"; + pass(3, "connected handlers"); $my->something_changed; - print "ok 6\n"; + pass(6); $my->something_changed; - print "ok 8\n"; + pass(8); $my->signal_handler_block ($id_b); $my->signal_handler_unblock ($id_b); - print "".($my->signal_handler_is_connected ($id_b) ? "ok" : "not ok"). " 9\n"; + ok($my->signal_handler_is_connected ($id_b), 9); $my->signal_handler_disconnect ($id_b); $my->something_changed; @@ -155,26 +178,26 @@ # this is part of the emission process going wrong, not a handler, # so it's a bug in the calling code, and thus we shouldn't eat it. eval { $my->test_marshaler (); }; - print $@ =~ m/Incorrect number/ - ? "ok 10 # signal_emit barfs on bad input\n" - : "not ok 10 # expected to croak but didn't\n"; + ok( $@ =~ m/Incorrect number/, 10, "signal_emit barfs on bad input" ); $my->test_marshaler (qw/foo bar 15/, $my); - print "ok 11\n"; + pass(11); my $id = $my->signal_connect (test_marshaler => sub { - print $_[0] == $my && - $_[1] eq 'foo' && - $_[2] && # string bar is true - $_[3] == 15 && # expect an int - $_[4] == $my && # object passes unmolested - $_[5][1] eq 'two' # user-data is an array ref - ? "ok 13 # marshaled as expected\n" - : "not ok 13 # bad params in callback\n"; + ok( $_[0] == $my && + $_[1] eq 'foo' && + $_[2] && # string bar is true + $_[3] == 15 && # expect an int + $_[4] == $my && # object passes unmolested + $_[5][1] eq 'two' # user-data is an array ref + , + 13, + "marshalling" + ); return 77.1; }, [qw/one two/, 3.1415]); - print ($id ? "ok 12\n" : "not ok\n"); + ok($id, 12); $my->test_marshaler (qw/foo bar/, 15, $my); - print "ok 14\n"; + pass(14); $my->signal_handler_disconnect ($id); @@ -193,18 +216,10 @@ my $tag; $tag = Glib->install_exception_handler (sub { - if ($tag) { - print "ok 16 # caught exception $_[0]\n"; - } else { - print "not ok # handler didn't uninstall itself\n"; - } + ok( $tag, 16, "exception_handler" ); 0 # returning FALSE uninstalls }, [qw/foo bar/, 0]); - print "" - . ($tag - ? "ok 15 # installed exception handler with tag $tag" - : "not ok 15 # got no tag back from install_exception_handler?!?") - . "\n"; + ok($tag, 15, "installed exception handler"); # the exception in the signal handler should not affect the value of # $@ at this code layer. @@ -212,54 +227,51 @@ print "# before invocation: \$@ $@\n"; $my->test_marshaler (qw/foo bar/, 4154, $my); print "# after invocation: \$@ $@\n"; - print "ok 17 # still alive after an exception in a callback\n"; - print "".($@ eq 'neener neener neener' - ? 'ok 18 # $@ is preserved across signal invocations' - : 'not ok # $@ not preserved correctly across signal invocation' - ."\n # expected 'neener neener neener'\n" - . " # got '$@'\n" - )."\n"; + pass(17, "still alive after an exception in a callback"); + ok($@ eq 'neener neener neener', 18, "$@ is preserved across signals") || + diag "# expected 'neener neener neener'\n", + " # got '$@'"; $tag = 0; # that was a single-shot -- the exception handler shouldn't run again. { local $SIG{__WARN__} = sub { if ($_[0] =~ m/unhandled/m) { - print "ok 20 # unhandled exception just warns\n" + pass(20, "unhandled exception just warns"); } elsif ($_[0] =~ m/isn't numeric/m) { - print "ok 19 # string value isn't numeric\n" + pass(19, "string value isn't numeric"); } else { - print "not ok # got something unexpected in __WARN__: $_[0]\n"; + fail("got something unexpected in __WARN__: $_[0]\n"); } }; $my->test_marshaler (qw/foo bar baz/, $my); - print "ok 21\n"; + pass(21); } use Data::Dumper; - $my->signal_connect (returner => sub { print "ok 23\n"; 0.5 }); + $my->signal_connect (returner => sub { pass(23); 0.5 }); # the class closure should be called in between these two - $my->signal_connect_after (returner => sub { print "ok 25\n"; 42.0 }); - print "ok 22\n"; + $my->signal_connect_after (returner => sub { pass(25); 42.0 }); + pass(22); my $ret = $my->returner; # we should have the return value from the last handler - print $ret == 42.0 ? "ok 26\n" : "not ok # expected 42.0, got $ret\n"; + ok( $ret == 42.0, 26 ) || diag("expected 42.0, got $ret"); # now with our special accumulator - $my->signal_connect (list_returner => sub { print "ok 28\n"; 10 }); - $my->signal_connect (list_returner => sub { print "ok 29\n"; '15' }); - $my->signal_connect (list_returner => sub { print "ok 30\n"; [20] }); - $my->signal_connect (list_returner => sub { print "ok 31\n"; {thing => 25} }); + $my->signal_connect (list_returner => sub { pass(28); 10 }); + $my->signal_connect (list_returner => sub { pass(29); '15' }); + $my->signal_connect (list_returner => sub { pass(30); [20] }); + $my->signal_connect (list_returner => sub { pass(31); {thing => 25} }); # class closure should before the "connect_after" ones, # and this one will stop everything by returning the magic value. - $my->signal_connect_after (list_returner => sub { print "ok 33 # stopper\n"; 42 }); + $my->signal_connect_after (list_returner => sub { pass(33, "stopper"); 42 }); # if this one is called, the accumulator isn't working right - $my->signal_connect_after (list_returner => sub { print "not ok # shouldn't get here\n"; 0 }); - print "ok 27\n"; + $my->signal_connect_after (list_returner => sub { fail("shouldn't get here"); 0 }); + pass(27); print Dumper( $my->list_returner ); } -print "ok 34\n"; +pass(34); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/9.t new/Glib-1.142/t/9.t --- old/Glib-1.140/t/9.t 2006-09-04 17:45:24.000000000 +0200 +++ new/Glib-1.142/t/9.t 2006-10-17 21:56:32.000000000 +0200 @@ -22,11 +22,11 @@ my $timeout = undef; print "ok 2\n"; -Glib::Idle->add (sub {print "ok 4 # idle one-shot\n"; 0}); +Glib::Idle->add (sub {print "ok 4 - idle one-shot\n"; 0}); Glib::Idle->add (sub { - print "ok 5 # another idle, but this one dies\n"; + print "ok 5 - another idle, but this one dies\n"; die "killer"; - print "not ok # after die, shouldn't get here!\n"; + print "not ok - after die, shouldn't get here!\n"; 1 # return true from idle to be called again; we # should never get here, though }); @@ -39,18 +39,18 @@ # the die will simply jump to the eval, leaving side effects in place. # we have to kill the mainloop ourselves. local $SIG{__DIE__} = sub { - print "ok 6 # in __DIE__ handler\n"; + print "ok 6 - in __DIE__ handler\n"; $loop->quit; }; local $SIG{__WARN__} = sub { print "" . ($_[0] =~ /unhandled exception in callback/ - ? "ok 7 # " - : "not ok # got something unexpected in __WARN__" + ? "ok 7" + : "not ok - got something unexpected in __WARN__" ) . "\n"; }; -print "ok 3 # running in eval\n"; +print "ok 3 - running in eval\n"; $loop->run; # remove this timeout to avoid confusing the next test. Glib::Source->remove ($timeout); @@ -59,13 +59,13 @@ # again, without dying in an idle this time print "ok 8\n"; Glib::Timeout->add (100, sub { - print "ok 10 # dying with 'waugh'\n"; + print "ok 10 - dying with 'waugh'\n"; die "waugh" }); my $loop = Glib::MainLoop->new; -print "ok 9 # running in eval\n"; +print "ok 9 - running in eval\n"; Glib->install_exception_handler (sub { - print "ok 11 # killing loop from exception handler\n"; + print "ok 11 - killing loop from exception handler\n"; $loop->quit; 0}); $loop->run; @@ -80,9 +80,9 @@ if ($Config{archname} =~ m/^(x86_64|mipsel|mips|alpha)/ and not Glib->CHECK_VERSION (2,2,4)) { - print "not ok 12 # skip bug in glib\n"; - print "not ok 13 # skip bug in glib\n"; - print "not ok 14 # skip bug in glib\n"; + print "not ok 12 - skip bug in glib\n"; + print "not ok 13 - skip bug in glib\n"; + print "not ok 14 - skip bug in glib\n"; } else { print "ok 12\n"; @@ -96,13 +96,13 @@ #print "'$_'"; #print "eof - ".eof ($_[0])."\n"; if (eof $_[0]) { - print "ok 14 # eof, dying with 'done\\n'\n"; + print "ok 14 - eof, dying with 'done\\n'\n"; die "done\n"; } 1; }); $loop = Glib::MainLoop->new; - print "ok 13 # running in eval\n"; + print "ok 13 - running in eval\n"; Glib->install_exception_handler (sub {$loop->quit; 0}); $loop->run; } @@ -116,12 +116,12 @@ # XXX Win32 doesn't do SIGALRM the way unix does; either the alarm # doesn't interrupt the poll, or alarm just doesn't work. my $reason = "async signals don't work on win32 like they do on unix"; - print "ok 15 # skip $reason\n"; - print "ok 16 # skip $reason\n"; + print "ok 15 - skip $reason\n"; + print "ok 16 - skip $reason\n"; } else { $loop = Glib::MainLoop->new; $SIG{ALRM} = sub { - print "ok 15 # ALRM handler\n"; + print "ok 15 - ALRM handler\n"; $loop->quit; }; my $timeout_fired = 0; @@ -134,14 +134,14 @@ $loop->run; print "" . ($timeout_fired ? "not ok" : "ok") - . " 16 # 1 sec alarm handler fires before 2 sec timeout\n"; + . " 16 - 1 sec alarm handler fires before 2 sec timeout\n"; } if (Glib->CHECK_VERSION (2, 4, 0)) { print Glib::main_depth == 0 ? "ok 17\n" : "not ok 17\n"; } else { - print "ok 17 # skip main_depth\n"; + print "ok 17 - skip main_depth\n"; } print $loop->is_running ? diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Glib-1.140/t/filename.t new/Glib-1.142/t/filename.t --- old/Glib-1.140/t/filename.t 2006-01-14 05:44:56.000000000 +0100 +++ new/Glib-1.142/t/filename.t 2006-10-17 21:56:32.000000000 +0200 @@ -51,8 +51,6 @@ # should not fail even on invalid stuff my $something = "/tmp/test\x{fe}\x{03}invalid"; - print "name: ".Glib::filename_display_name ($something)."\n"; - print "basename: ".Glib::filename_display_basename ($something)."\n"; ok (Glib::filename_display_name ($something)); ok (Glib::filename_display_basename ($something)); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org