Commit b99a1a6c authored by Guido van Rossum's avatar Guido van Rossum

Improved test, by Mark Hammond, for Win32.

parent 6b803be4
......@@ -4,9 +4,9 @@ import string, os, re, sys
PAGESIZE = mmap.PAGESIZE
def test_unix():
"Test mmap module on Unix systems"
def test_both():
"Test mmap module on Unix systems and Windows"
# Create an mmap'ed file
f = open('foo', 'w+')
......@@ -14,8 +14,11 @@ def test_unix():
f.write('\0'* PAGESIZE)
f.write('foo')
f.write('\0'* (PAGESIZE-3) )
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
if sys.platform[:3]=="win":
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
else:
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
f.close()
# Simple sanity checks
......@@ -61,9 +64,5 @@ def test_unix():
print ' Test passed'
# XXX need to write a test suite for Windows
if sys.platform == 'win32':
pass
else:
test_unix()
test_both()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment