subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1766585 - /subversion/trunk/subversion/tests/libsvn_subr/xml-test.c
Date Tue, 25 Oct 2016 19:30:07 GMT
Author: stsp
Date: Tue Oct 25 19:30:06 2016
New Revision: 1766585

URL: http://svn.apache.org/viewvc?rev=1766585&view=rev
Log:
Fix a spurious test failure on OpenBSD due to a bug in the test:

subversion/tests/libsvn_subr/xml-test.c:184: (apr_err=SVN_ERR_TEST_FAILED)
svn_tests: E200006: Got unxpected error '(null)'
FAIL:  xml-test 4: test svn_xml_signal_bailout() for invalid XML

* subversion/tests/libsvn_subr/xml-test.c
  (test_invalid_xml_signal_bailout): SVN_TEST_ASSERT_ANY_ERROR() will clear the
   error so make a copy of its status value and use it instead of err->apr_err.

Found by: bb-openbsd buildbot

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/xml-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/xml-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/xml-test.c?rev=1766585&r1=1766584&r2=1766585&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/xml-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/xml-test.c Tue Oct 25 19:30:06 2016
@@ -168,6 +168,7 @@ test_invalid_xml_signal_bailout(apr_pool
   const char *xml = "<root><tag1></tag1>";
   xml_callbacks_baton_t b;
   svn_error_t *err;
+  apr_status_t status;
 
   b.buf = svn_stringbuf_create_empty(pool);
   b.parser = svn_xml_make_parser(&b, NULL, err_end_elem, NULL, pool);
@@ -176,14 +177,14 @@ test_invalid_xml_signal_bailout(apr_pool
   /* We may get SVN_ERR_XML_MALFORMED or error from err_end_elem() callback.
    * This behavior depends how XML parser works: it may pre-parse data before
    * callback invocation. */
-  SVN_TEST_ASSERT_ANY_ERROR(err);
+  status = err->apr_err;
+  SVN_TEST_ASSERT_ANY_ERROR(err); /* This clears err! */
 
-  if (err->apr_err != SVN_ERR_XML_MALFORMED &&
-      err->apr_err != APR_EGENERAL)
+  if (status != SVN_ERR_XML_MALFORMED && status != APR_EGENERAL)
     {
       return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
                                "Got unxpected error '%s'",
-                               svn_error_symbolic_name(err->apr_err));
+                               svn_error_symbolic_name(status));
     }
 
   return SVN_NO_ERROR;



Mime
View raw message