[Python-checkins] CVS: python/dist/src/Lib/test test_mmap.py,1.1,1.2

Guido van Rossum python-dev@python.org
Thu, 30 Mar 2000 20:09:17 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Lib/test
In directory eric:/projects/python/develop/guido/src/Lib/test

Modified Files:
	test_mmap.py 
Log Message:
Improved test, by Mark Hammond, for Win32.


Index: test_mmap.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/test_mmap.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_mmap.py	2000/03/30 21:15:29	1.1
--- test_mmap.py	2000/03/31 01:09:14	1.2
***************
*** 5,11 ****
  PAGESIZE = mmap.PAGESIZE
  
! def test_unix():
!     "Test mmap module on Unix systems"
!     	
      # Create an mmap'ed file
      f = open('foo', 'w+')
--- 5,11 ----
  PAGESIZE = mmap.PAGESIZE
  
! def test_both():
!     "Test mmap module on Unix systems and Windows"
!     
      # Create an mmap'ed file
      f = open('foo', 'w+')
***************
*** 15,20 ****
      f.write('foo')
      f.write('\0'* (PAGESIZE-3) )
!     
!     m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
      f.close()
      
--- 15,23 ----
      f.write('foo')
      f.write('\0'* (PAGESIZE-3) )
! 
!     if sys.platform[:3]=="win":
!         m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
!     else:
!         m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
      f.close()
      
***************
*** 62,69 ****
      print ' Test passed'
  
! # XXX need to write a test suite for Windows
! if sys.platform == 'win32':
!     pass
! else:
!     test_unix()
!     
--- 65,68 ----
      print ' Test passed'
  
! test_both()
!