~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tuned_gzip.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        # and it should be new member time in the stream.
87
87
        self.failUnless(myfile._new_member)
88
88
 
 
89
    def test_negative_crc(self):
 
90
        """Content with a negative crc should not break when written"""
 
91
        sio = StringIO()
 
92
        gfile = tuned_gzip.GzipFile(mode="w", fileobj=sio)
 
93
        gfile.write("\xFF")
 
94
        gfile.close()
 
95
        self.assertEqual(gfile.crc & 0xFFFFFFFFL, 0xFF000000L)
 
96
        self.assertEqual(sio.getvalue()[-8:-4], "\x00\x00\x00\xFF")
 
97
 
89
98
 
90
99
class TestToGzip(TestCase):
91
100