Author: rschupp
Date: Thu Jan  1 22:21:32 2015
New Revision: 1648959

URL: http://svn.apache.org/r1648959
Log:
Perl bindings: fix a test when running a debug build.

[in subversion/bindings/swig/perl]

* native/t/3client.t: In a debug build, the svn_error_t returned from a
  function may be the top of a chain of svn_error_t's (all with message 
  "traced call") with the original svn_error_t at the bottom.
  Also check for the correct apr_err value (SVN_ERR_CANCELLED).

Modified:
    subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t

Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t?rev=1648959&r1=1648958&r2=1648959&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t Thu Jan  
1 22:21:32 2015
@@ -20,7 +20,7 @@
 #
 #
 
-use Test::More tests => 301;
+use Test::More tests => 302;
 use strict;
 
 # shut up about variables that are only used once.
@@ -1141,11 +1141,21 @@ $svn_error = $ctx->log5($reposurl,
               undef, # revprops
               sub { });
 # TEST
-isa_ok($svn_error, '_p_svn_error_t');
+isa_ok($svn_error, '_p_svn_error_t', 'return of a cancelled operation');
 # TEST
-is($svn_error->message, $cancel_msg, 'operation was cancelled');
+is($svn_error->apr_err, $SVN::Error::CANCELLED, "SVN_ERR_CANCELLED");
+{
+    # If we're running a debug build, $svn_error may be the top of a
+    # chain of svn_error_t's (all with message "traced call"), we need 
+    # to get to the bottom svn_error_t to check for the original message.
+    my $chained = $svn_error;
+    $chained = $chained->child while $chained->child;
+    # TEST
+    is($chained->message, $cancel_msg, 'cancellation message');
+}
+
 $svn_error->clear(); # don't leak this
-$ctx->cancel(undef); # reset callback
+$ctx->cancel(undef); # reset cancel callback
 
 
 SKIP: {


Reply via email to