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
7fd90c40
Kaydet (Commit)
7fd90c40
authored
May 04, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11277: test_zlib tests a buffer of 1 GB on 32 bits
(instead of a buffer of 2 GB)
üst
6fa09472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
test_zlib.py
Lib/test/test_zlib.py
+15
-6
No files found.
Lib/test/test_zlib.py
Dosyayı görüntüle @
7fd90c40
...
...
@@ -2,7 +2,7 @@ import unittest
from
test.test_support
import
TESTFN
,
run_unittest
,
import_module
,
unlink
,
requires
import
binascii
import
random
from
test.test_support
import
precisionbigmemtest
,
_1G
from
test.test_support
import
precisionbigmemtest
,
_1G
,
_4G
import
sys
try
:
...
...
@@ -72,20 +72,29 @@ class ChecksumTestCase(unittest.TestCase):
zlib
.
crc32
(
'spam'
,
(
2
**
31
)))
# Issue #11277 - check that inputs of 2 GB are handled correctly.
# Be aware of issues #1202, #8650, #8651 and #10276
# Issue #11277 - check that inputs of 2 GB (or 1 GB on 32 bits system) are
# handled correctly. Be aware of issues #1202. We cannot test a buffer of 4 GB
# or more (#8650, #8651 and #10276), because the zlib stores the buffer size
# into an int.
class
ChecksumBigBufferTestCase
(
unittest
.
TestCase
):
int_max
=
0x7FFFFFFF
if
sys
.
maxsize
>
_4G
:
# (64 bits system) crc32() and adler32() stores the buffer size into an
# int, the maximum filesize is INT_MAX (0x7FFFFFFF)
filesize
=
0x7FFFFFFF
else
:
# (32 bits system) On a 32 bits OS, a process cannot usually address
# more than 2 GB, so test only 1 GB
filesize
=
_1G
@unittest.skipUnless
(
mmap
,
"mmap() is not available."
)
def
test_big_buffer
(
self
):
if
sys
.
platform
[:
3
]
==
'win'
or
sys
.
platform
==
'darwin'
:
requires
(
'largefile'
,
'test requires
%
s bytes and a long time to run'
%
str
(
self
.
int_max
))
str
(
self
.
filesize
))
try
:
with
open
(
TESTFN
,
"wb+"
)
as
f
:
f
.
seek
(
self
.
int_max
-
4
)
f
.
seek
(
self
.
filesize
-
4
)
f
.
write
(
"asdf"
)
f
.
flush
()
m
=
mmap
.
mmap
(
f
.
fileno
(),
0
,
access
=
mmap
.
ACCESS_READ
)
...
...
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