Your IP : 216.73.217.129


Current Path : /opt/alt/python38/lib64/python3.8/test/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/test/__pycache__/test_bigaddrspace.cpython-38.pyc

U

i�f��@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�;/opt/alt/python38/lib64/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__ZtestrZtest.supportrrZunittestrr#ZTestCaserrr%r�len�argvZset_memlimitrrrr�<module>s
%'