mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Also fix pickletester
This commit is contained in:
parent
382e8b515c
commit
b7591d4780
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ from pickle import bytes_types
|
||||||
# kind of outer loop.
|
# kind of outer loop.
|
||||||
protocols = range(pickle.HIGHEST_PROTOCOL + 1)
|
protocols = range(pickle.HIGHEST_PROTOCOL + 1)
|
||||||
|
|
||||||
character_size = 4 if sys.maxunicode > 0xFFFF else 2
|
ascii_char_size = 1
|
||||||
|
|
||||||
|
|
||||||
# Return True if opcode code appears in the pickle, else False.
|
# Return True if opcode code appears in the pickle, else False.
|
||||||
|
@ -1235,7 +1235,7 @@ class BigmemPickleTests(unittest.TestCase):
|
||||||
# All protocols use 1-byte per printable ASCII character; we add another
|
# All protocols use 1-byte per printable ASCII character; we add another
|
||||||
# byte because the encoded form has to be copied into the internal buffer.
|
# byte because the encoded form has to be copied into the internal buffer.
|
||||||
|
|
||||||
@bigmemtest(size=_2G, memuse=2 + character_size, dry_run=False)
|
@bigmemtest(size=_2G, memuse=2 + ascii_char_size, dry_run=False)
|
||||||
def test_huge_str_32b(self, size):
|
def test_huge_str_32b(self, size):
|
||||||
data = "abcd" * (size // 4)
|
data = "abcd" * (size // 4)
|
||||||
try:
|
try:
|
||||||
|
@ -1252,7 +1252,7 @@ class BigmemPickleTests(unittest.TestCase):
|
||||||
# BINUNICODE (protocols 1, 2 and 3) cannot carry more than
|
# BINUNICODE (protocols 1, 2 and 3) cannot carry more than
|
||||||
# 2**32 - 1 bytes of utf-8 encoded unicode.
|
# 2**32 - 1 bytes of utf-8 encoded unicode.
|
||||||
|
|
||||||
@bigmemtest(size=_4G, memuse=1 + character_size, dry_run=False)
|
@bigmemtest(size=_4G, memuse=1 + ascii_char_size, dry_run=False)
|
||||||
def test_huge_str_64b(self, size):
|
def test_huge_str_64b(self, size):
|
||||||
data = "a" * size
|
data = "a" * size
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue