mirror of
https://github.com/python/cpython.git
synced 2026-01-03 14:02:21 +00:00
on both Unix (SVR4 and BSD) and Windows. Restores behaviour of passing -1 for anonymous memory on Unix. Use MAP_ANONYMOUS instead of _ANON since the latter is deprecated according to Linux (gentoo) man pages. Should we continue to allow mmap.mmap(0, length) to work on Windows? 0 is a valid fd. Will backport bugfix portions.
38 lines
1.4 KiB
Text
38 lines
1.4 KiB
Text
test_mmap
|
|
<type 'mmap.mmap'>
|
|
Position of foo: 1.0 pages
|
|
Length of file: 2.0 pages
|
|
Contents of byte 0: '\x00'
|
|
Contents of first 3 bytes: '\x00\x00\x00'
|
|
|
|
Modifying file's content...
|
|
Contents of byte 0: '3'
|
|
Contents of first 3 bytes: '3\x00\x00'
|
|
Contents of second page: '\x00foobar\x00'
|
|
Regex match on mmap (page start, length of match): 1.0 6
|
|
Seek to zeroth byte
|
|
Seek to 42nd byte
|
|
Seek to last byte
|
|
Try to seek to negative position...
|
|
Try to seek beyond end of mmap...
|
|
Try to seek to negative position...
|
|
Attempting resize()
|
|
Creating 10 byte test data file.
|
|
Opening mmap with access=ACCESS_READ
|
|
Ensuring that readonly mmap can't be slice assigned.
|
|
Ensuring that readonly mmap can't be item assigned.
|
|
Ensuring that readonly mmap can't be write() to.
|
|
Ensuring that readonly mmap can't be write_byte() to.
|
|
Ensuring that readonly mmap can't be resized.
|
|
Opening mmap with size too big
|
|
Opening mmap with access=ACCESS_WRITE
|
|
Modifying write-through memory map.
|
|
Opening mmap with access=ACCESS_COPY
|
|
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.
|
|
anonymous mmap.mmap(-1, PAGESIZE)...
|
|
Test passed
|