Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
044dfadd
Kaydet (Commit)
044dfadd
authored
May 07, 2011
tarafından
Nadeem Vawda
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge: #11277: Fix tests - crash will not trigger if the file is closed and reopened.
üst
c2bb0737
909f6d2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
test_mmap.py
Lib/test/test_mmap.py
+12
-14
No files found.
Lib/test/test_mmap.py
Dosyayı görüntüle @
044dfadd
...
...
@@ -663,27 +663,26 @@ class LargeMmapTests(unittest.TestCase):
def
tearDown
(
self
):
unlink
(
TESTFN
)
def
_
creat
e_test_file
(
self
,
num_zeroes
,
tail
):
def
_
mak
e_test_file
(
self
,
num_zeroes
,
tail
):
if
sys
.
platform
[:
3
]
==
'win'
or
sys
.
platform
==
'darwin'
:
requires
(
'largefile'
,
'test requires
%
s bytes and a long time to run'
%
str
(
0x180000000
))
with
open
(
TESTFN
,
'wb'
)
as
f
:
try
:
f
.
seek
(
num_zeroes
)
f
.
write
(
tail
)
f
.
flush
()
except
(
IOError
,
OverflowError
):
raise
unittest
.
SkipTest
(
"filesystem does not have largefile support"
)
f
=
open
(
TESTFN
,
'w+b'
)
try
:
f
.
seek
(
num_zeroes
)
f
.
write
(
tail
)
f
.
flush
()
except
(
IOError
,
OverflowError
):
raise
unittest
.
SkipTest
(
"filesystem does not have largefile support"
)
return
f
def
test_large_offset
(
self
):
self
.
_create_test_file
(
0x14FFFFFFF
,
b
" "
)
with
open
(
TESTFN
,
'rb'
)
as
f
:
with
self
.
_make_test_file
(
0x14FFFFFFF
,
b
" "
)
as
f
:
with
mmap
.
mmap
(
f
.
fileno
(),
0
,
offset
=
0x140000000
,
access
=
mmap
.
ACCESS_READ
)
as
m
:
self
.
assertEqual
(
m
[
0xFFFFFFF
],
32
)
def
test_large_filesize
(
self
):
self
.
_create_test_file
(
0x17FFFFFFF
,
b
" "
)
with
open
(
TESTFN
,
'rb'
)
as
f
:
with
self
.
_make_test_file
(
0x17FFFFFFF
,
b
" "
)
as
f
:
with
mmap
.
mmap
(
f
.
fileno
(),
0x10000
,
access
=
mmap
.
ACCESS_READ
)
as
m
:
self
.
assertEqual
(
m
.
size
(),
0x180000000
)
...
...
@@ -693,8 +692,7 @@ class LargeMmapTests(unittest.TestCase):
tail
=
b
' DEARdear '
start
=
boundary
-
len
(
tail
)
//
2
end
=
start
+
len
(
tail
)
self
.
_create_test_file
(
start
,
tail
)
with
open
(
TESTFN
,
'rb'
)
as
f
:
with
self
.
_make_test_file
(
start
,
tail
)
as
f
:
with
mmap
.
mmap
(
f
.
fileno
(),
0
,
access
=
mmap
.
ACCESS_READ
)
as
m
:
self
.
assertEqual
(
m
[
start
:
end
],
tail
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment