r30518 - in /branches/upstream/libglib-perl/current: ChangeLog GLog.xs GParamSpec.xs GSignal.xs GType.xs Glib.pm Glib.xs META.yml MakeHelper.pm Makefile.PL NEWS ParseXSDoc.pm README t/a.t t/c.t t/e.t t/options.t

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Sun Feb 8 01:14:40 UTC 2009


Author: ryan52-guest
Date: Sun Feb  8 01:14:36 2009
New Revision: 30518

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30518
Log:
[svn-upgrade] Integrating new upstream version, libglib-perl (1.212)

Modified:
    branches/upstream/libglib-perl/current/ChangeLog
    branches/upstream/libglib-perl/current/GLog.xs
    branches/upstream/libglib-perl/current/GParamSpec.xs
    branches/upstream/libglib-perl/current/GSignal.xs
    branches/upstream/libglib-perl/current/GType.xs
    branches/upstream/libglib-perl/current/Glib.pm
    branches/upstream/libglib-perl/current/Glib.xs
    branches/upstream/libglib-perl/current/META.yml
    branches/upstream/libglib-perl/current/MakeHelper.pm
    branches/upstream/libglib-perl/current/Makefile.PL
    branches/upstream/libglib-perl/current/NEWS
    branches/upstream/libglib-perl/current/ParseXSDoc.pm
    branches/upstream/libglib-perl/current/README
    branches/upstream/libglib-perl/current/t/a.t
    branches/upstream/libglib-perl/current/t/c.t
    branches/upstream/libglib-perl/current/t/e.t
    branches/upstream/libglib-perl/current/t/options.t

Modified: branches/upstream/libglib-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/ChangeLog?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/ChangeLog (original)
+++ branches/upstream/libglib-perl/current/ChangeLog Sun Feb  8 01:14:36 2009
@@ -1,3 +1,67 @@
+2009-02-05  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* Glib.pm
+	* NEWS
+	* README: Unstable release 1.212.
+
+2009-02-03  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* t/a.t
+	* GLog.xs: Make sure that messages with % chars in them make it
+	through Glib::log() and friends safely.
+
+2009-02-02  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* ParseXSDoc.pm (xsdocparse): Always use Data::Dumper on MSWin32
+	for serialization.  Storable seems to consistently fail there,
+	stating 'Magic number checking on storable file failed'.
+
+2009-02-02  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* Glib.xs
+	* GSignal.xs: Hush some compiler warnings.
+
+2009-01-20  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* Glib.pm: Add documentation for Glib->filename_to_uri and
+	filename_from_uri.  Patch by Kevin Ryde.
+
+2009-01-18  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* GParamSpec.xs
+	* t/e.t: Add Glib::ParamSpec->value_cmp.  Patch by Kevin Ryde.
+
+2009-01-18  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* t/e.t: Use UTF-8 instead of ISO-8859-1 to encode umlauts.
+
+2009-01-18  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* GParamSpec.xs
+	* t/e.t: Add Glib::ParamSpec->value_validate.  Patch by Kevin
+	Ryde.
+
+2009-01-18  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* t/options.t: Don't use UTF-8 umlauts unconditionally as this
+	causes trouble on non-UTF-8 locales.
+
+2009-01-18  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* MakeHelper.pm: Add
+	Glib::MakeHelper->postamble_precompiled_headers to generate a make
+	target for precompiling headers.
+
+	* Makefile.PL: Use the above to create a 'precompiled-headers'
+	target that precompiles gperl.h.  This speeds up the compilation
+	of Glib by 16% on my machine.
+
+2008-12-30  Torsten Schoenfeld  <kaffeetisch at gmx.de>
+
+	* GType.xs
+	* t/c.t: Allow calling Glib::Flags::as_arrayref directly, as an
+	alternative to the @{} syntax.  Patch by Kevin Ryde.
+
 2008-11-24  Torsten Schoenfeld  <kaffeetisch at gmx.de>
 
 	* Glib.pm

Modified: branches/upstream/libglib-perl/current/GLog.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/GLog.xs?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/GLog.xs (original)
+++ branches/upstream/libglib-perl/current/GLog.xs Sun Feb  8 01:14:36 2009
@@ -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.
  *
- * $Id: GLog.xs 1028 2008-10-05 12:49:32Z tsch $
+ * $Id: GLog.xs 1067 2009-02-03 19:24:42Z tsch $
  */
 
 #include "gperl.h"
@@ -235,7 +235,7 @@
 
 void g_log (class, gchar_ornull * log_domain, SV * log_level, const gchar *message)
     CODE:
-	g_log (log_domain, SvGLogLevelFlags (log_level), message);
+	g_log (log_domain, SvGLogLevelFlags (log_level), "%s", message);
 
 MODULE = Glib::Log	PACKAGE = Glib::Log	PREFIX = g_log_
 
@@ -292,7 +292,7 @@
 		case 2: flags = G_LOG_LEVEL_CRITICAL; break;
 		case 3: flags = G_LOG_LEVEL_WARNING; break;
 	}
-	g_log (domain, flags, message);
+	g_log (domain, flags, "%s", message);
 
 ##
 ## these are not needed -- perl's print() and warn() do the job.

Modified: branches/upstream/libglib-perl/current/GParamSpec.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/GParamSpec.xs?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/GParamSpec.xs (original)
+++ branches/upstream/libglib-perl/current/GParamSpec.xs Sun Feb  8 01:14:36 2009
@@ -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.
  *
- * $Id: GParamSpec.xs 1028 2008-10-05 12:49:32Z tsch $
+ * $Id: GParamSpec.xs 1061 2009-01-18 15:20:50Z tsch $
  */
 
 #include "gperl.h"
@@ -625,6 +625,64 @@
 	RETVAL
 
 
+MODULE = Glib::ParamSpec	PACKAGE = Glib::ParamSpec	PREFIX = g_param_
+
+=for apidoc
+=signature bool = $paramspec->value_validate ($value)
+=signature (bool, newval) = $paramspec->value_validate ($value)
+In scalar context return true if $value must be modified to be valid
+for $paramspec, or false if it's valid already.  In array context
+return also a new value which is $value made valid.
+
+$value must be the right type for $paramspec (with usual stringizing,
+numizing, etc).  C<value_validate> checks the further restrictions
+such as minimum and maximum for a numeric type or allowed characters
+in a string.  The "made valid" return is then for instance clamped to
+the min/max, or offending chars replaced by a substitutor.
+=cut
+void
+g_param_value_validate (GParamSpec * pspec, SV *value)
+    PREINIT:
+	GValue v = { 0, };
+	GType type;
+	int modify, retcount=1;
+    CODE:
+	type = G_PARAM_SPEC_VALUE_TYPE (pspec);
+	g_value_init (&v, type);
+	gperl_value_from_sv (&v, value);
+	modify = g_param_value_validate (pspec, &v);
+	ST(0) = sv_2mortal (boolSV (modify));
+	if (GIMME_V == G_ARRAY) {
+		ST(1) = sv_2mortal (gperl_sv_from_value (&v));
+		retcount = 2;
+	}
+	g_value_unset (&v);
+	XSRETURN(retcount);
+
+=for
+Compares I<value1> with I<value2> according to I<pspec>, and returns -1, 0 or
++1, if value1 is found to be less than, equal to or greater than value2,
+respectively.
+=cut
+int
+g_param_values_cmp (GParamSpec * pspec, SV *value1, SV *value2)
+    PREINIT:
+	GValue v1 = { 0, };
+	GValue v2 = { 0, };
+	GType type;
+    CODE:
+	type = G_PARAM_SPEC_VALUE_TYPE (pspec);
+	g_value_init (&v1, type);
+	g_value_init (&v2, type);
+	gperl_value_from_sv (&v1, value1);
+	gperl_value_from_sv (&v2, value2);
+	RETVAL = g_param_values_cmp (pspec, &v1, &v2);
+	g_value_unset (&v1);
+	g_value_unset (&v2);
+    OUTPUT:
+	RETVAL
+
+
 MODULE = Glib::ParamSpec	PACKAGE = Glib::Param::Char
 
  ## actually for all signed integer types

Modified: branches/upstream/libglib-perl/current/GSignal.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/GSignal.xs?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/GSignal.xs (original)
+++ branches/upstream/libglib-perl/current/GSignal.xs Sun Feb  8 01:14:36 2009
@@ -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.
  *
- * $Id: GSignal.xs 1028 2008-10-05 12:49:32Z tsch $
+ * $Id: GSignal.xs 1063 2009-02-02 20:09:34Z tsch $
  */
 
 =head2 GSignal
@@ -538,7 +538,7 @@
 	if (((guint)(items-ARGOFFSET)) != query.n_params) 
 		croak ("Incorrect number of arguments for emission of signal %s in class %s; need %d but got %d",
 		       name, G_OBJECT_TYPE_NAME (instance),
-		       query.n_params, items-ARGOFFSET);
+		       query.n_params, (gint) items-ARGOFFSET);
 
 	/* set up the parameters to g_signal_emitv.   this is an array
 	 * of GValues, where [0] is the emission instance, and the rest 
@@ -988,7 +988,7 @@
 		       "expected %d, got %d",
 		       g_signal_name (ihint->signal_id),
 		       1 + query.n_params,
-		       items);
+		       (gint) items);
 
 	instance_and_params = g_new0 (GValue, 1 + query.n_params);
 

Modified: branches/upstream/libglib-perl/current/GType.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/GType.xs?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/GType.xs (original)
+++ branches/upstream/libglib-perl/current/GType.xs Sun Feb  8 01:14:36 2009
@@ -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.
  *
- * $Id: GType.xs 1048 2008-11-15 13:43:25Z tsch $
+ * $Id: GType.xs 1055 2008-12-30 14:12:37Z tsch $
  */
 
 =head2 GType / GEnum / GFlags
@@ -2776,14 +2776,18 @@
         RETVAL
 
 =for apidoc
-=for arg b (SV*)
-=for arg swap (integer)
+=for signature ref = $a->as_arrayref
+=for arg ... (__hide__)
 =cut
 SV *
-as_arrayref (SV *a, b, swap)
+as_arrayref (SV *a, ...)
     PROTOTYPE: $;@
     CODE:
 {
+	/* overload @{} calls here with the usual three args "a,b,swap", but
+	 * "b" and "swap" have no meaning.  Using "..." to ignore them lets
+	 * users call method-style with no args "$f->as_arrayref" too.
+	 */
 	GType gtype;
 	const char *package;
         gint a_;

Modified: branches/upstream/libglib-perl/current/Glib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/Glib.pm?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/Glib.pm (original)
+++ branches/upstream/libglib-perl/current/Glib.pm Sun Feb  8 01:14:36 2009
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2008 by the gtk2-perl team (see the file AUTHORS for
+# Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for
 # the full list)
 #
 # This library is free software; you can redistribute it and/or modify it under
@@ -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.
 #
-# $Id: Glib.pm 1053 2008-11-24 09:29:56Z tsch $
+# $Id: Glib.pm 1070 2009-02-05 12:28:08Z tsch $
 #
 
 package Glib;
@@ -66,7 +66,7 @@
 our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
 $EXPORT_TAGS{all} = \@EXPORT_OK;
 
-our $VERSION = '1.211';
+our $VERSION = '1.212';
 
 sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
 
@@ -420,7 +420,7 @@
 
 =back
 
-Other functions for converting URIs are currently missing. Also, it might
+It might
 be useful to know that perl currently has no policy at all regarding
 filename issues, if your scalar happens to be in utf-8 internally it will
 use utf-8, if it happens to be stored as bytes, it will use it as-is.
@@ -440,7 +440,54 @@
 necessarily reversible.  These functions are intended to be used for failsafe
 display of filenames, for example in gtk+ labels.
 
-Since gtk+ 2.6, Glib 1.12
+Since glib 2.6, Glib 1.12
+
+=back
+
+The following convert filenames to and from URI encoding.  (See also
+L<URI::file>.)
+
+=over 4
+
+=item $string = filename_to_uri ($filename, $hostname)
+
+=item $string = Glib->filename_to_uri ($filename, $hostname)
+
+Return a "file://" schema URI for a filename.  Unsafe and non-ascii chars in
+C<$filename> are escaped with URI "%" forms.
+
+C<$filename> must be an absolute path as a byte string in local filesystem
+encoding.  C<$hostname> is a utf-8 string, or empty or C<undef> for no host
+specified.  For example,
+
+    filename_to_uri ('/my/x%y/<dir>/foo.html', undef);
+    # returns 'file:///my/x%25y/%3Cdir%3E/foo.html'
+
+If C<$filename> is a relative path or C<$hostname> doesn't look like a
+hostname then C<filename_to_uri> croaks with a C<Glib::Error>.
+
+When using the class style C<< Glib->filename_to_uri >> remember that the
+C<$hostname> argument is mandatory.  If you forget then it looks like a
+2-argument call with filename of "Glib" and hostname of what you meant to be
+the filename.
+
+=item $filename = filename_from_uri ($uri)
+
+=item ($filename, $hostname) = filename_from_uri ($uri)
+
+Extract the filename and hostname from a "file://" schema URI.  In scalar
+context just the filename is returned, in array context both filename and
+hostname are returned.
+
+The filename returned is bytes in the local filesystem encoding.  The
+hostname returned is utf-8.  For example,
+
+    ($f,$h) = filename_from_uri ('file://foo.com/r%26b/bar.html');
+    # returns '/r&b/bar.html' and 'foo.com'
+
+If C<$uri> is not a "file:", or is mal-formed, or the hostname part doesn't
+look like a host name then C<filename_from_uri> croaks with a
+C<Glib::Error>.
 
 =back
 

Modified: branches/upstream/libglib-perl/current/Glib.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/Glib.xs?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/Glib.xs (original)
+++ branches/upstream/libglib-perl/current/Glib.xs Sun Feb  8 01:14:36 2009
@@ -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.
  *
- * $Id: Glib.xs 1052 2008-11-22 14:21:54Z tsch $
+ * $Id: Glib.xs 1064 2009-02-02 20:15:50Z tsch $
  */
 
 #include "gperl.h"
@@ -100,18 +100,18 @@
         dTHR;
 
         GError *error = NULL;
-        gchar *lname;
-        STRLEN len;
-        gchar *filename = SvPVutf8 (sv, len);
-
-	/* look out: len is the length of the input when we call, but
-	 * will be the length of the output when this call finishes. */
-        lname = g_filename_from_utf8 (filename, len, 0, &len, &error);
+        gchar *lname = NULL;
+        gsize output_length = 0;
+        STRLEN input_length = 0;
+        gchar *filename = SvPVutf8 (sv, input_length);
+
+        lname = g_filename_from_utf8 (filename, input_length,
+                                      0, &output_length, &error);
         if (!lname)
         	gperl_croak_gerror (NULL, error);
 
-        filename = gperl_alloc_temp (len + 1);
-        memcpy (filename, lname, len);
+        filename = gperl_alloc_temp (output_length + 1);
+        memcpy (filename, lname, output_length);
         g_free (lname);
 
         return filename;

Modified: branches/upstream/libglib-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/META.yml?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/META.yml (original)
+++ branches/upstream/libglib-perl/current/META.yml Sun Feb  8 01:14:36 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Glib
-version:            1.211
+version:            1.212
 abstract:           Perl wrappers for the GLib utility and Object libraries
 author:  []
 license:            unknown

Modified: branches/upstream/libglib-perl/current/MakeHelper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/MakeHelper.pm?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/MakeHelper.pm (original)
+++ branches/upstream/libglib-perl/current/MakeHelper.pm Sun Feb  8 01:14:36 2009
@@ -1,5 +1,5 @@
 #
-# $Id: MakeHelper.pm 1028 2008-10-05 12:49:32Z tsch $
+# $Id: MakeHelper.pm 1056 2009-01-18 13:34:20Z tsch $
 #
 
 package Glib::MakeHelper;
@@ -171,12 +171,14 @@
 
 =cut
 
+our @ADDITIONAL_FILES_TO_CLEAN = ();
+
 sub postamble_clean
 {
 	shift; # package name
 "
 realclean ::
-	-\$(RM_RF) build perl-\$(DISTNAME).spec ".join(" ", @_)."
+	-\$(RM_RF) build perl-\$(DISTNAME).spec @ADDITIONAL_FILES_TO_CLEAN @_
 ";
 }
 
@@ -508,6 +510,37 @@
 ";
 }
 
+=item string = Glib::MakeHelper->postamble_precompiled_headers (@headers)
+
+Create and return the text of Makefile rules for a 'precompiled-headers' target
+that precompiles I<@headers>.  If you call this before you call
+C<postamble_clean>, all temporary files will be removed by the 'realclean'
+target.
+
+=cut
+
+sub postamble_precompiled_headers
+{
+	shift; # package name
+	my @headers = @_;
+	my @precompiled_headers = ();
+	my $rules = "";
+	foreach my $header (@headers) {
+		my $output = $header . '.gch';
+		push @precompiled_headers, $output;
+		push @ADDITIONAL_FILES_TO_CLEAN, $output;
+		$rules .= <<PCH;
+
+$output: $header
+	\$(CCCMD) \$(CCCDLFLAGS) "-I\$(PERL_INC)" \$(PASTHRU_DEFINE) \$(DEFINE) $header
+PCH
+	}
+	$rules .= <<PCH;
+
+precompiled-headers: @precompiled_headers
+PCH
+}
+
 package MY;
 
 =back

Modified: branches/upstream/libglib-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/Makefile.PL?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/Makefile.PL (original)
+++ branches/upstream/libglib-perl/current/Makefile.PL Sun Feb  8 01:14:36 2009
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.PL 1052 2008-11-22 14:21:54Z tsch $
+# $Id: Makefile.PL 1057 2009-01-18 13:37:35Z tsch $
 #
 
 BEGIN { require 5.008; }
@@ -212,6 +212,7 @@
 	\$(NOECHO) $^X apidoc.pl xsapi.pod.head xsapi.pod.foot build/doc.pl > \$@
 
 "
+	     . Glib::MakeHelper->postamble_precompiled_headers (qw/gperl.h/)
 	     . Glib::MakeHelper->postamble_clean ()
 	     . Glib::MakeHelper->postamble_docs_full (
 			DEPENDS => $glib,

Modified: branches/upstream/libglib-perl/current/NEWS
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/NEWS?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/NEWS (original)
+++ branches/upstream/libglib-perl/current/NEWS Sun Feb  8 01:14:36 2009
@@ -1,3 +1,15 @@
+Overview of changes in Glib 1.212
+=================================
+
+* Allow calling Glib::Flags->as_arrayref directly, as an alternative to the @{}
+  syntax.
+* Add Glib::ParamSpec->value_validate and Glib::ParamSpec->value_cmp.
+* Add documentation for Glib->filename_to_uri and filename_from_uri.
+* Always use Data::Dumper instead of Storable on MSWin32 for serialization work
+  during documentation generation.
+* Make sure that messages with % chars in them make it through Glib->log and
+  friends safely.
+
 Overview of changes in Glib 1.211
 =================================
 

Modified: branches/upstream/libglib-perl/current/ParseXSDoc.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/ParseXSDoc.pm?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/ParseXSDoc.pm (original)
+++ branches/upstream/libglib-perl/current/ParseXSDoc.pm Sun Feb  8 01:14:36 2009
@@ -85,9 +85,11 @@
 
 	# Data::Dumper converts the whole output to a string, and consequently
 	# uses an obscene amount of ram on Gtk2's nearly 200 xs files.  Use
-	# Storable unless the user really really wants to force us to fall
-	# back to Data::Dumper.
-	if ($ENV{FORCE_DATA_DUMPER}) {
+	# Storable unless the user really really wants to force us to fall back
+	# to Data::Dumper.  Storable doesn't seem to work well on win32, so
+	# always use Data::Dumper there.
+	my $use_dd = $ENV{FORCE_DATA_DUMPER} || $^O eq 'MSWin32';
+	if ($use_dd) {
 		$Data::Dumper::Purity = 1;
 		print Data::Dumper->Dump([$parser->{xspods}, $parser->{data}],
 		                       [qw($xspods            $data)]);

Modified: branches/upstream/libglib-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/README?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/README (original)
+++ branches/upstream/libglib-perl/current/README Sun Feb  8 01:14:36 2009
@@ -1,4 +1,4 @@
-Glib version 1.211
+Glib version 1.212
 ==================
 
 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 1053 2008-11-24 09:29:56Z tsch $
+# $Id: README 1070 2009-02-05 12:28:08Z tsch $

Modified: branches/upstream/libglib-perl/current/t/a.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/t/a.t?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/t/a.t (original)
+++ branches/upstream/libglib-perl/current/t/a.t Sun Feb  8 01:14:36 2009
@@ -20,7 +20,7 @@
 	# have to bail out.
 	plan skip_all => "g_log doubles messages by accident on 64-bit platforms";
 } else {
-	plan tests => 11;
+	plan tests => 12;
 }
 
 package Foo;
@@ -30,7 +30,7 @@
 
 package main;
 
-$SIG{__WARN__} = sub { ok(1, "in __WARN__: $_[0]"); };
+$SIG{__WARN__} = sub { chomp (my $msg = $_[0]); ok(1, "in __WARN__: $msg"); };
 #$SIG{__DIE__} = sub { ok(1, 'in __DIE__'); };
 
 Glib->message (undef, 'whee message');
@@ -90,6 +90,19 @@
 #print "$@\n";
 #}
 
+# Check that messages with % chars make it through unaltered and don't cause
+# crashes
+{
+	my $id = Glib::Log->set_handler (
+		__PACKAGE__,
+		qw/debug/,
+		sub { is($_[2], '%s %d %s', 'a message with % chars'); });
+
+	Glib->log (__PACKAGE__, qw/debug/, '%s %d %s');
+
+	Glib::Log->remove_handler (__PACKAGE__, $id);
+}
+
 Glib::Log->set_fatal_mask (__PACKAGE__, [qw/ warning message /]);
 Glib::Log->set_always_fatal ([qw/ info debug /]);
 

Modified: branches/upstream/libglib-perl/current/t/c.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/t/c.t?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/t/c.t (original)
+++ branches/upstream/libglib-perl/current/t/c.t Sun Feb  8 01:14:36 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # vim: set filetype=perl :
 #
-# $Id: c.t 1028 2008-10-05 12:49:32Z tsch $
+# $Id: c.t 1055 2008-12-30 14:12:37Z tsch $
 #
 
 #
@@ -13,7 +13,7 @@
 
 #########################
 
-use Test::More tests => 34;
+use Test::More tests => 35;
 BEGIN { use_ok('Glib') };
 
 #########################
@@ -216,6 +216,7 @@
 is ($obj->get ('some_enum'), 'value-two', 'enum property, after set');
 
 is_deeply (\@{ $obj->get ('some_flags') }, ['value-one'], 'flags property');
+is_deeply ($obj->get('some_flags')->as_arrayref, ['value-one'], 'flags property');
 $obj->set (some_flags => ['value-one', 'value-two']);
 is_deeply (\@{ $obj->get ('some_flags') }, ['value-one', 'value-two'],
 	   'flags property, after set');

Modified: branches/upstream/libglib-perl/current/t/e.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/t/e.t?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/t/e.t (original)
+++ branches/upstream/libglib-perl/current/t/e.t Sun Feb  8 01:14:36 2009
@@ -3,8 +3,9 @@
 # ParamSpec stuff.
 #
 use strict;
+use utf8;
 use Glib ':constants';
-use Test::More tests => 232;
+use Test::More tests => 243;
 
 # first register some types with which to play below.
 
@@ -160,9 +161,9 @@
 
 $pspec = Glib::ParamSpec->unichar ('unichar', 'Unichar',
 	                           'is that like unixsex?',
-	                           'ö', qw/readable/);
+	                           'ö', qw/readable/);
 pspec_common_ok ($pspec, 'Unichar', qw/readable/, 'Glib::UInt');
-is ($pspec->get_default_value, 'ö', 'Unichar default');
+is ($pspec->get_default_value, 'ö', 'Unichar default');
 push @params, $pspec;
 
 
@@ -215,3 +216,28 @@
 my $object = Bar->new;
 my $x = $object->get ('param_spec');
 is ($x, undef);
+
+
+
+#
+# value_validate() and value_cmp()
+#
+{ my $p = Glib::ParamSpec->int ('name','nick','blurb',
+                                20, 50, 25, G_PARAM_READWRITE);
+  ok (! scalar ($p->value_validate('30')), "value 30 valid");
+  my @a = $p->value_validate('30');
+  is (@a, 2);
+  ok (! $a[0], "value 30 bool no modify (array context)");
+  is ($a[1], 30, "value 30 value unchanged");
+
+  my ($modif, $newval) = $p->value_validate(70);
+  ok ($modif, 'modify 70 to be in range');
+  is ($newval, 50, 'clamp 70 down to be in range');
+  ($modif, $newval) = $p->value_validate(-70);
+  ok ($modif, 'modify -70 to be in range');
+  is ($newval, 20, 'clamp -70 down to be in range');
+
+  is ($p->values_cmp(22, 33), -1);
+  is ($p->values_cmp(33, 22), 1);
+  is ($p->values_cmp(22, 22), 0);
+}

Modified: branches/upstream/libglib-perl/current/t/options.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libglib-perl/current/t/options.t?rev=30518&op=diff
==============================================================================
--- branches/upstream/libglib-perl/current/t/options.t (original)
+++ branches/upstream/libglib-perl/current/t/options.t Sun Feb  8 01:14:36 2009
@@ -140,18 +140,18 @@
   # Test actual parsing.
   {
     @ARGV = qw(-n
-               -s blä
+               -s bla
                -i 42
                --filename ~/Foo
-               --string-array äää --string-array ööö
+               --string-array aaa --string-array bbb
                --filename-array /usr/bin/bla --filename-array ./harness);
     $context -> parse();
 
     is ($none, FALSE);
-    is ($string, 'blä');
+    is ($string, 'bla');
     is ($int, 42);
     is ($filename, '~/Foo');
-    is_deeply ($string_array, [qw/äää ööö/]);
+    is_deeply ($string_array, [qw/aaa bbb/]);
     is_deeply ($filename_array, [qw(/usr/bin/bla ./harness)]);
   }
 }




More information about the Pkg-perl-cvs-commits mailing list