• Jeremy Hylton's avatar
    Add a test specifically for damaged transaction headers. · 43007a55
    Jeremy Hylton authored
    We're still missing tests that cover important cases.  Unexecuted code
    below:
    
    >>>>>>             if l > len(data) - 8:
    >>>>>>                 pos += l
    >>>>>>                 break
    >>>>>>             s = l + 1
    >>>>>>             tl = u64(data[s:s+8])
    >>>>>>             if tl < pos:
    >>>>>>                 return pos + s + 8
    
    >>>>>>         except:
    >>>>>>             if partial and nrec:
    >>>>>>                 ofs._status = 'p'
    >>>>>>                 ofs.tpc_vote(transaction)
    >>>>>>                 ofs.tpc_finish(transaction)
    >>>>>>                 if verbose:
    >>>>>>                     print 'partial'
                       else:
    >>>>>>                 ofs.tpc_abort(transaction)
    >>>>>>             print "\n%s: %s\n" % sys.exc_info()[:2]
    >>>>>>             if not verbose:
    >>>>>>                 progress(prog1)
    >>>>>>             pos = scan(file, pos)
    43007a55
testRecover.py 4.54 KB