diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/output/test_mmap | 1 | ||||
-rw-r--r-- | Lib/test/test_mmap.py | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/output/test_mmap b/Lib/test/output/test_mmap index 02b24bc..1ce4943 100644 --- a/Lib/test/output/test_mmap +++ b/Lib/test/output/test_mmap @@ -31,6 +31,7 @@ test_mmap Modifying copy-on-write memory map. Ensuring copy-on-write maps cannot be resized. Ensuring invalid access parameter raises exception. + Try opening a bad file descriptor... Ensuring that passing 0 as map length sets map size to current file size. Ensuring that passing 0 as map length sets map size to current file size. Test passed diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 849f170..6930317 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -281,6 +281,14 @@ def test_both(): except OSError: pass + print ' Try opening a bad file descriptor...' + try: + mmap.mmap(-1, 4096) + except mmap.error: + pass + else: + verify(0, 'expected a mmap.error but did not get it') + # Do a tougher .find() test. SF bug 515943 pointed out that, in 2.2, # searching for data with embedded \0 bytes didn't work. f = open(TESTFN, 'w+') |