HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/__pycache__/test_bigaddrspace.cpython-38.pyc
U

-D�g��@s�dZddlmZddlmZmZddlZddlZddlZGdd�dej	�Z
Gdd�dej	�Zd	d
�Ze
dkr�eej�dkr�e�ejd�e�dS)
aT
These tests are meant to exercise that requests to create objects bigger
than what the address space allows are properly met with an OverflowError
(rather than crash weirdly).

Primarily, this means 32-bit builds with at least 2 GiB of available memory.
You need to pass the -M option to regrtest (e.g. "-M 2.1G") for tests to
be enabled.
�)�support)�bigaddrspacetest�MAX_Py_ssize_tNc@s0eZdZedd��Zedd��Zedd��ZdS)�	BytesTestcCs.z"dtd}|�ttj|d�W5d}XdS�N�x�s�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r�assertRaises�
OverflowError�operator�add��self�x�r�5/opt/cppython/lib/python3.8/test/test_bigaddrspace.py�test_concatszBytesTest.test_concatc	CsXzLdtd}|�t��}|d}W5QRX|�t��}|d7}W5QRXW5d}XdSr)rr	r
�rr�cmrrr�test_optimized_concat szBytesTest.test_optimized_concatcCs.z"dtd}|�ttj|d�W5d}XdS)Nrr)rr	r
r�mulr
rrr�test_repeat/szBytesTest.test_repeatN)�__name__�
__module__�__qualname__rrrrrrrrrs


rc@sBeZdZejdkrdndZedd��Zedd��Zedd	��Z	d
S)�StrTesti��cCs8z,dttd|j�}|�ttj||�W5d}XdS�Nr皙�����?)�intr�unicodesizer	�MemoryErrorrrr
rrrr<szStrTest.test_concatc	CsbzVdttd|j�}|�t��}||}W5QRX|�t��}||7}W5QRXW5d}XdSr)r rr!r	r"rrrrrGszStrTest.test_optimized_concatcCs8z,dttd|j�}|�ttj|d�W5d}XdS)Nrrr)r rr!r	r"rrr
rrrrVszStrTest.test_repeatN)
rrr�sys�
maxunicoder!rrrrrrrrr8s


rcCst�tt�dS)N)rZrun_unittestrrrrrr�	test_main_sr%�__main__�)�__doc__�testrZtest.supportrrZunittestrr#ZTestCaserrr%r�len�argvZset_memlimitrrrr�<module>s
%'