Index: Lib/test/test_mmap.py =================================================================== --- Lib/test/test_mmap.py (revision 70847) +++ Lib/test/test_mmap.py (working copy) @@ -1,6 +1,7 @@ from test.test_support import TESTFN, run_unittest, import_module import unittest import os, re +import itertools as it mmap = import_module('mmap') @@ -351,11 +352,25 @@ self.assertEqual(m[:], expected) m.close() - # should not crash - m = mmap.mmap(-1, 1) - self.assertRaises(ValueError, m.move, 1, 1, -1) + # segfault test + m = mmap.mmap(-1, 100) + offsets = [-100, -1, 0, 1, 100] + for source, dest, size in it.product(offsets, offsets, offsets): + try: + m.move(source, dest, size) + except ValueError: + pass m.close() + # boundry test + self.assertRaises(ValueError, m.move, -1, -1, -1) + self.assertRaises(ValueError, m.move, -1, -1, 0) + self.assertRaises(ValueError, m.move, -1, 0, -1) + self.assertRaises(ValueError, m.move, 0, -1, -1) + self.assertRaises(ValueError, m.move, -1, 0, 0) + self.assertRaises(ValueError, m.move, 0, -1, 0) + self.assertRaises(ValueError, m.move, 0, 0, -1) + def test_anonymous(self): # anonymous mmap.mmap(-1, PAGE) m = mmap.mmap(-1, PAGESIZE)