Your IP : 216.73.216.85


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_bigaddrspace.cpython-35.opt-1.pyc



��Yf��@s�dZddlmZddlmZmZddlZddlZddlZGdd�dej	�Z
Gdd�dej	�Zd	d
�Ze
dkr�eej�dkr�ejejd�e�dS)
aS
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 GB 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@sFeZdZedd��Zedd��Zedd��ZdS)�	BytesTestcCs=z/dtd}|jttj|dd�Wdd}XdS)N�x�)r�assertRaises�
OverflowError�operator�add)�self�x�r�;/opt/alt/python35/lib64/python3.5/test/test_bigaddrspace.py�test_concats!zBytesTest.test_concatcCsnz`dtd}|jt��}|dd}WdQRX|jt��}|dd7}WdQRXWdd}XdS)Nrr)rrr	)rr
�cmrrr�test_optimized_concat szBytesTest.test_optimized_concatcCs9z+dtd}|jttj|d�Wdd}XdS)Nrr)rrr	r
�mul)rr
rrr�test_repeat/szBytesTest.test_repeatN)�__name__�
__module__�__qualname__rrrrrrrrrsrc@saeZdZejdkr!dndZedd��Zedd��Zedd	��Z	d
S)�StrTesti��cCsFz8dttd|j�}|jttj||�Wdd}XdS)Nr
g�������?)�intr�unicodesizer�MemoryErrorr
r)rr
rrrr<szStrTest.test_concatcCsszedttd|j�}|jt��}||}WdQRX|jt��}||7}WdQRXWdd}XdS)Nr
g�������?)rrrrr)rr
rrrrrGszStrTest.test_optimized_concatcCsFz8dttd|j�}|jttj|d�Wdd}XdS)Nr
g�������?r)rrrrrr
r)rr
rrrrVszStrTest.test_repeatN)
rrr�sys�
maxunicoderrrrrrrrrr8srcCstjtt�dS)N)rZrun_unittestrrrrrr�	test_main_sr �__main__�)�__doc__ZtestrZtest.supportrrZunittestr
rZTestCaserrr r�len�argvZset_memlimitrrrr�<module>	s%'