예제 #1
0
    def testDumpsLastRegionPartiallyWhenSizeLimitIsReached(self):
        r0, r1, r2 = R(0, 10), R(20, 10), R(40, 10)
        self.assertEqual(
            _GetStartAndDumpedSize(memory._ApplySizeLimit([r0, r1, r2], 19)),
            [(0, 10), (20, 9)])

        r0, r1, r2 = R(0, 10), R(20, 10), R(40, 10)
        self.assertEqual(
            _GetStartAndDumpedSize(memory._ApplySizeLimit([r0, r1, r2], 11)),
            [(0, 10), (20, 1)])

        r0, r1, r2 = R(0, 10), R(20, 10), R(40, 10)
        self.assertEqual(
            _GetStartAndDumpedSize(memory._ApplySizeLimit([r0, r1, r2], 1)),
            [(0, 1)])
예제 #2
0
 def testExcludesFollowingRegionsAfterLimit(self):
     r0, r1, r2 = R(0, 10), R(20, 10), R(40, 10)
     self.assertEqual(
         _GetStartAndDumpedSize(memory._ApplySizeLimit([r0, r1, r2], 20)),
         [(0, 10), (20, 10)])
예제 #3
0
 def testDumpsRegionsFullyInSizeLimit(self):
     r0, r1, r2 = R(0, 10), R(20, 10), R(40, 10)
     self.assertEqual(
         _GetStartAndDumpedSize(memory._ApplySizeLimit([r0, r1, r2], 30)),
         [(0, 10), (20, 10), (40, 10)])