Changeset 4986
- Timestamp:
- Feb 5, 2008, 1:31:57 PM (17 years ago)
- Location:
- anuga_core/source/anuga/utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/system_tools.py
r4977 r4986 180 180 """ 181 181 182 #from zlib import crc32 183 from binascii import crc32 #(works as well) 182 from zlib import crc32 183 # On bogong binascii.crc32 gave a different answer to 184 # zlib.crc32 185 #from binascii import crc32 #(works as well on 32 bit machines) 184 186 185 187 fid = open(filename) 186 188 crcval = crc32(fid.read(max_length)) 189 187 190 fid.close() 188 191 return crcval -
anuga_core/source/anuga/utilities/test_system_tools.py
r4977 r4986 42 42 fid.write(string) 43 43 fid.flush() 44 44 fid.close() 45 45 46 46 ref_crc = zlib.crc32(string) 47 47 48 checksum = compute_checksum(tmp_name) 48 49 49 50 checksum = compute_checksum(tmp_name)51 50 52 51 assert checksum == ref_crc 53 52 54 fid.close()55 53 os.remove(tmp_name) 56 54 57 58 55 59 56
Note: See TracChangeset
for help on using the changeset viewer.