Changeset 11144
- Timestamp:
- 04/01/07 16:08:20 (2 years ago)
- Files:
-
- trunk/autotest/gdrivers/hfa.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/autotest/gdrivers/hfa.py
r11109 r11144 102 102 103 103 ############################################################################### 104 # Verify we can read suspicious int data.105 106 def hfa_int_ read():104 # Verify we can read metadata of int.img. 105 106 def hfa_int_stats_1(): 107 107 108 108 ds = gdal.Open('data/int.img') … … 141 141 142 142 ############################################################################### 143 # Verify we can read suspicious int data statistics.144 145 def hfa_int_stats ():143 # Verify we can read band statistics of int.img. 144 145 def hfa_int_stats_2(): 146 146 147 147 ds = gdal.Open('data/int.img') … … 170 170 171 171 ############################################################################### 172 # Verify we can read suspicious int data.173 174 def hfa_float_ read():172 # Verify we can read metadata of float.img. 173 174 def hfa_float_stats_1(): 175 175 176 176 ds = gdal.Open('data/float.img') … … 217 217 218 218 ############################################################################### 219 # Verify we can read suspicious float data statistics.220 221 def hfa_float_stats ():219 # Verify we can read band statistics of float.img. 220 221 def hfa_float_stats_2(): 222 222 223 223 ds = gdal.Open('data/float.img') … … 245 245 return 'success' 246 246 247 ############################################################################### 248 # Verify we can read image data. 249 250 def hfa_int_read(): 251 252 ds = gdal.Open('data/int.img') 253 band = ds.GetRasterBand(1) 254 cs = band.Checksum() 255 data = band.ReadRaster(100, 100, 1, 1) 256 ds = None 257 258 if cs != 6691: 259 gdaltest.post_reason( 'Checksum value is wrong.' ) 260 return 'fail' 261 262 return 'success' 263 264 ############################################################################### 265 # Verify we can read image data. 266 267 def hfa_float_read(): 268 269 ds = gdal.Open('data/float.img') 270 band = ds.GetRasterBand(1) 271 cs = band.Checksum() 272 data = band.ReadRaster(100, 100, 1, 1) 273 ds = None 274 275 if cs != 23529: 276 gdaltest.post_reason( 'Checksum value is wrong.' ) 277 return 'fail' 278 279 # Read raw data into tuple of float numbers 280 import struct 281 value = struct.unpack('f' * 1, data)[0] 282 283 if abs(value - 41.021659851074219) > 0.0001: 284 gdaltest.post_reason( 'Pixel value is wrong.' ) 285 return 'fail' 286 287 return 'success' 288 247 289 ############################################################################### 248 290 # … … 251 293 hfa_histread, 252 294 hfa_histwrite, 295 hfa_int_stats_1, 296 hfa_int_stats_2, 297 hfa_float_stats_1, 298 hfa_float_stats_2, 253 299 hfa_int_read, 254 hfa_int_stats, 255 hfa_float_read, 256 hfa_float_stats ] 300 hfa_float_read] 257 301 258 302 if __name__ == '__main__':
