[ [ [
Improving support for svn_checksum.h in SWIG bindings.
* subversion/bindings/swig/python/tests/checksum.py: "swig-py: Adding tests for
svn_checksum_dup() and svn_checksum_match()"
Patch by: Shivani Poddar <[email protected]>
<shivani.poddar92%40gmail.com>
Review by : breser
] ] ]
Regards,
Shivani Poddar,
irc-nik -> trinity_28
Index: subversion/bindings/swig/python/tests/checksum.py
===================================================================
--- subversion/bindings/swig/python/tests/checksum.py (revision 1448005)
+++ subversion/bindings/swig/python/tests/checksum.py (working copy)
@@ -27,15 +27,20 @@
# function
kind, expected_length = svn.core.svn_checksum_md5, 128/8
val = svn.core.svn_checksum_create(kind)
+ duplicate = svn.core.svn_checksum_dup(val)
check_val = svn.core.svn_checksum_to_cstring_display(val)
-
+ #create manual duplicate of val to check svn_checksum_match()
+ dup_val = val
self.assertTrue(isinstance(check_val, str),
"Type of digest not string")
self.assertEqual(len(check_val), 2*expected_length,
"Length of digest does not match kind")
self.assertEqual(int(check_val), 0,
"Value of initialized digest is not 0")
-
+ self.assertTrue(isinstance(svn.core.svn_checksum_match(val,dup_val),
int),"Type returned is not int(0/1) or boolean")
+ #check for the function svn_checksum_dup() independently
+ self.assertTrue(svn.core.svn_checksum_match(val,duplicate),
+ "Argument 2 is not a duplicate of argument 1")
def suite():
return unittest.defaultTestLoader.loadTestsFromTestCase(ChecksumTestCases)