/[Apache-SVN]
ViewVC logotype

Revision 1539407


Jump to revision: Previous Next
Author: brane
Date: Wed Nov 6 17:34:08 2013 UTC (10 years, 5 months ago)
Changed paths: 5
Log Message:
Added a test case for the JavaHL svn:externals parser, consequently
uncovering a couple of nasty bugs and a silly thinko.

[in subversion/bindings/javahl]
* native/ExternalItem.cpp
  (make_external_item): Send the correct number of parameters to
   the private ExternalItem constructor.

* native/jniwrapper/jni_array.hpp
  (ByteArray::data):
   Add a note to the docstring that the result will not be NUL-terminated.
  (ByteArray::get_string): Reimplement so that it copies the data to a pool
   and properly NUL-terminates it, so that it can be used as a C string.

* native/org_apache_subversion_javahl_util_PropLib.cpp
  (operator==, operator!=): Comparison operators for svn_opt_revision_t.
  (Java_org_apache_subversion_javahl_util_PropLib_parseExternals):
   Scope the String and ByteArray contents accessors so that they can be made
   constant, i.e., immutable as per spec.
   Make a NUL-terminated copy of the array contents before using them.
  (Java_org_apache_subversion_javahl_util_PropLib_unparseExternals):
   Do not generate the -rN option if the revision and peg are the same.
   Likewise do not barf on a non-HEAD peg revision oldstyle mode.
   Scope the String contents accessor to make it constant.

* src/org/apache/subversion/javahl/types/ExternalItem.java
  (ExternalItem.ExternalItem): Default a null revision to the peg revision
   value instead of HEAD, and update the docstring.
  (ExternalItem.equals): New; equality checker.

* tests/org/apache/subversion/javahl/UtilTests.java
  (externals): Add 5 more cases to cover ExternalItem changes.
  (old_externals): Swap revision and peg parameters.
  (externals_propval, old_externals_propval): New.
  (compare_item_lists): New.
  (testParseExternals): New test case.
  (testUnparseExternals): Check result against externals_propval.
  (testUnparseExternalsOldstyle): Check result against old_externals_propval.


Changed paths

Path Details
Directorysubversion/trunk/subversion/bindings/javahl/native/ExternalItem.cpp modified , text changed
Directorysubversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_array.hpp modified , text changed
Directorysubversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp modified , text changed
Directorysubversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ExternalItem.java modified , text changed
Directorysubversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26