/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__dirstate_helpers.py

Change tests to always expect truncation not clamping for times

Show diffs side-by-side

added added

removed removed

Lines of Context:
1357
1357
        self.assertEqual(0x80000ABC, self.unpack_field(packed, "st_ino"))
1358
1358
 
1359
1359
    def test_giant_size(self):
1360
 
        packed = self.pack((33252, 0, 0, 0, 0, 0, 1<<33, 0, 0, 0))
1361
 
        self.assertEqual((1 << 32) - 1, self.unpack_field(packed, "st_size"))
 
1360
        packed = self.pack((33252, 0, 0, 0, 0, 0, (1 << 33) + 4096, 0, 0, 0))
 
1361
        self.assertEqual(4096, self.unpack_field(packed, "st_size"))
1362
1362
 
1363
1363
    def test_fractional_mtime(self):
1364
1364
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, 16.9375, 0))
1366
1366
 
1367
1367
    def test_ancient_mtime(self):
1368
1368
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, -11644473600.0, 0))
1369
 
        self.assertEqual(0, self.unpack_field(packed, "st_mtime"))
 
1369
        self.assertEqual(1240428288, self.unpack_field(packed, "st_mtime"))
1370
1370
 
1371
1371
    def test_distant_mtime(self):
1372
1372
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, 64060588800.0, 0))
1373
 
        self.assertEqual((1 << 32) - 1, self.unpack_field(packed, "st_mtime"))
 
1373
        self.assertEqual(3931046656, self.unpack_field(packed, "st_mtime"))
1374
1374
 
1375
1375
    def test_fractional_ctime(self):
1376
1376
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, 0, 17.5625))
1378
1378
 
1379
1379
    def test_ancient_ctime(self):
1380
1380
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, 0, -11644473600.0))
1381
 
        self.assertEqual(0, self.unpack_field(packed, "st_ctime"))
 
1381
        self.assertEqual(1240428288, self.unpack_field(packed, "st_ctime"))
1382
1382
 
1383
1383
    def test_distant_ctime(self):
1384
1384
        packed = self.pack((33252, 0, 0, 0, 0, 0, 0, 0, 0, 64060588800.0))
1385
 
        self.assertEqual((1 << 32) - 1, self.unpack_field(packed, "st_ctime"))
 
1385
        self.assertEqual(3931046656, self.unpack_field(packed, "st_ctime"))
1386
1386
 
1387
1387
    def test_negative_dev(self):
1388
1388
        packed = self.pack((33252, 0, -0xFFFFFCDE, 0, 0, 0, 0, 0, 0, 0))