[Liblas-commits] r1116 - in trunk/python: liblas tests
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Mar 19 18:34:35 EDT 2009
Author: hobu
Date: Thu Mar 19 18:34:35 2009
New Revision: 1116
URL: http://liblas.org/changeset/1116
Log:
beef up test for _Destroy being called twice
Modified:
trunk/python/liblas/core.py
trunk/python/tests/File.txt
Modified: trunk/python/liblas/core.py
==============================================================================
--- trunk/python/liblas/core.py (original)
+++ trunk/python/liblas/core.py Thu Mar 19 18:34:35 2009
@@ -69,11 +69,12 @@
def check_void_done(result, func, cargs):
"Error checking for void* returns that might be empty with no error"
- if not bool(result):
- if las.LASError_GetErrorCount():
- msg = 'LASError in "%s": %s' % (func.__name__, las.LASError_GetLastErrorMsg() )
- las.LASError_Reset()
- raise LASException(msg)
+ if las.LASError_GetErrorCount():
+ msg = 'LASError in "%s": %s' % (func.__name__, las.LASError_GetLastErrorMsg() )
+ las.LASError_Reset()
+ raise LASException(msg)
+
+
return result
def check_value(result, func, cargs):
"Error checking proper value returns"
Modified: trunk/python/tests/File.txt
==============================================================================
--- trunk/python/tests/File.txt (original)
+++ trunk/python/tests/File.txt Thu Mar 19 18:34:35 2009
@@ -106,6 +106,18 @@
>>> import os
>>> os.remove('junk.las')
+ >>> f = file.File('junk.las', mode="w", header=header)
+ >>> import liblas.core
+ >>> liblas.core.las.LASWriter_Destroy(f.handle)
+ 0
+ >>> print 'destroyed once'
+ destroyed once
+ >>> f.handle = None
+ >>> liblas.core.las.LASWriter_Destroy(f.handle)
+ Traceback (most recent call last):
+ ...
+ LASException: LASError in "LASWriter_Destroy": Pointer 'hWriter' is NULL in 'LASWriter_Destroy'.
+
# >>> f = file.File('junk.las2')
# Traceback (most recent call last):
# ...
More information about the Liblas-commits
mailing list