[perl-Glib] Tests: do not try to modify a read-only value



commit 2a466bf13ca57f6b6260849c884302f3893a1a7b
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Tue Sep 10 22:21:50 2013 +0200

    Tests: do not try to modify a read-only value
    
    t/7.t was failing on perl 5.19.4 because it attempted to assign to undef.

 NEWS  |    7 ++++++-
 t/7.t |   14 +++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4873564..9674604 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Overview of changes in Glib <next>
+==========================================
+
+* Fix a test failure with perl >= 5.19.4.
+* Create a GType for GSpawnFlags and register it with the bindings.
+
 Overview of changes in Glib 1.302 (stable)
 ==========================================
 
@@ -5,7 +11,6 @@ Overview of changes in Glib 1.302 (stable)
   conjunction with certain XS modules, among them XML::Parser and
   String::Approx.
 * Avoid memory corruption when registering boxed synonyms repeatedly.
-* Create a GType for GSpawnFlags and register it with the bindings.
 
 Overview of changes in Glib 1.301 (stable)
 ==========================================
diff --git a/t/7.t b/t/7.t
index 6203725..1bee20e 100644
--- a/t/7.t
+++ b/t/7.t
@@ -84,23 +84,23 @@ use Glib::Object::Subclass
              flags         => 'run-last',
              return_type   => 'Glib::Scalar',
              accumulator   => sub {
-                 # the accumulator gets (ihint, return_accu, handler_return)
+                 my ($ihint, $return_accu, $handler_return) = @_;
                  # let's turn the return_accu into a list of all the handlers'
                  # return values.  this is weird, but the sort of thing you
                  # might actually want to do.
-                 print "# in accumulator, got $_[2], previously "
-                     . (defined ($_[1]) ? $_[1] : 'undef')
+                 print "# in accumulator, got $handler_return, previously "
+                     . (defined ($return_accu) ? $return_accu : 'undef')
                      . "\n";
-                 if ('ARRAY' eq ref $_[1]) {
-                        push @{$_[1]}, $_[2];
+                 if ('ARRAY' eq ref $return_accu) {
+                        push @{$return_accu}, $handler_return;
                  } else {
-                        $_[1] = [$_[2]];
+                        $return_accu = [$handler_return];
                  }
                  # we must return two values --- a boolean that says whether
                  # the signal keeps emitting, and the accumulated return value.
                  # we'll stop emitting if the handler returns the magic 
                  # value 42.
-                 ($_[2] != 42, $_[1])
+                 ($handler_return != 42, $return_accu)
             },
          },
       },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]