관리-도구
편집 파일: test_RefPat.cpython-37.opt-1.pyc
B �]_B � @ s� d dl mZ d dlZd dlZd dlZd dlZG dd� dej�ZG dd� de�ZG dd� de�Zdd d �Z dd� Z ed kr~e � dS )� )�supportNc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�TestCasec C s$ t j�| � | jj| _| jj| _d S )N)r r �setUpZheapy�RefPatZUse�iso)�self� r �O/opt/alt/python37/lib64/python3.7/site-packages/guppy/heapy/test/test_RefPat.pyr s zTestCase.setUpc C s� g }g }xt |�D ]}|�|g� qW |g| }x\t |d �D ]L}g }x>t |�D ]2}g }|�|� xt |�D ]} |�|| � qlW qPW |}q>W |} | |fS )N� )�range�append)r �width�length�dstZls�iZxs�jZys�k�srcr r r � makegraph s zTestCase.makegraphc K sB | j }|d k r||�}||�jf d|i|��}dd� |jjj_|S )Nr c S s dS )Nz <address>r )�ar r r �<lambda>- � zTestCase.rp.<locals>.<lambda>)r Zget_rp�modZUniSetZsummary_strZstr_address)r r r �kwdsr �rpr r r r ( s zTestCase.rpN)�__name__� __module__�__qualname__r r r r r r r r s r c @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) � RefPatCasec C s. g }}|g}x t d�D ]}|g}|�|� qW | j||dd�}x2t|�D ]&\}}|t|�k rJ| �|| |j� qJW | �|d j|d � | �|d j|d � | j||dd�}| �|d j|d � | �|d j|d � | �t|�t|�d � | j||dd�}| �t|�t|�d � | �|jj|d � | �|j j|d � | j||dd�}| �|j j|d � | �|j j|d � |d �|d � |j�� |j� | �|d �� | �|j j|d � g }|�|� |g}| �||�}| �|jj|� | �|j | �||�� | �|j |j � | �|j |d � d S ) N� � )�depthr ������r � )r r r � enumerate�len�asis�theone�aseq�_r Za2�ViewZclear_retainersZupdate_referrersr )r r r Zlistsr r �xr r r �test_basic_methods2 sD zRefPatCase.test_basic_methodsc s� t �� � g }� fdd���j}d��fdd� }g }|�|� |||� x"td�D ]}|}g }|�|� qPW |||� ��dd�\}}|||dd� ��dd �\}}|||d d�}�t|j�� ��d d�\}}|||dd�}|j}�t|�� �t|j�� |j} �t| �� |j} �t| j�� �t| j�� �| j � �| j � ��d d�\}}|||dd�}�|j� �|jj� ��d d�\}}|||d d�}�|j� �j||dd�}�|j� ��� � � d� d S )Nc s t | � d� d S )N)�file)�print)r, )�outputr r �writez s z+RefPatCase.test_presentation.<locals>.writec s � j | |f|�}�t|�� |S )N)r �repr)r r �resultr r )r r1 r r �test_pp~ s z-RefPatCase.test_presentation.<locals>.test_ppr � r )r! � r � �# � � a� Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [R] 1 tuple: <address>*1 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [-] 1 list: <address>*1 3: a3 [-] 1 list: <address>*1 4: a4 ------ [-] 1 list: <address>*1 5: a5 [-] 1 list: <address>*1 6: a6 -------- [-] 1 list: <address>*1 7: a7 [R] 1 tuple: <address>*1 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 2: aa ---- [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 3: a3 [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 4: a4 ------ [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 5: a5 [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 6: a6 -------- [-] 5 list: <address>*5, <address>*5, <address>*5... 7: a7 [-] 1 list: <address>*5 8: a8 ---------- [R] 1 tuple: <address>*1 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 2: aa ---- [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 3: a3 [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 4: a4 ------ [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 5: a5 [-] 5 list: <address>*5, <address>*5, <address>*5, <address>*5... 6: a6 -------- [-] 5 list: <address>*5, <address>*5, <address>*5... 7: a7 [-] 5 list: <address>*5, <address>*5, <address>*5... 8: a8 ---------- [-] 5 list: <address>*5, <address>*5, <address>*5... 9: a9 [-] 5 list: <address>*5, <address>*5, <address>*5... <Type e.g. '_.more' for more.> 10: a10 ----------- [-] 5 list: <address>*5, <address>*5, <address>*5... 11: a11 [-] 5 list: <address>*5, <address>*5, <address>*5... 12: a12 ------------- [-] 5 list: <address>*5, <address>*5, <address>*5... 13: a13 [-] 5 list: <address>*5, <address>*5, <address>*5... 14: a14 --------------- [-] 5 list: <address>*5, <address>*5, <address>*5... 15: a15 [-] 5 list: <address>*5, <address>*5, <address>*5... 16: a16 ----------------- [-] 5 list: <address>*5, <address>*5, <address>*5... 17: a17 [+] 1 list: <address>*5 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [-] 1 list: <address>*1 3: a3 [-] 1 list: <address>*1 4: a4 ------ [-] 1 list: <address>*1 5: a5 [-] 1 list: <address>*1 6: a6 -------- [-] 1 list: <address>*1 7: a7 [-] 1 list: <address>*1 8: a8 ---------- [-] 1 list: <address>*1 9: a9 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 10: a10 ----------- [-] 1 list: <address>*1 11: a11 [-] 1 list: <address>*1 12: a12 ------------- [-] 1 list: <address>*1 13: a13 [-] 1 list: <address>*1 14: a14 --------------- [-] 1 list: <address>*1 15: a15 [-] 1 list: <address>*1 16: a16 ----------------- [-] 1 list: <address>*1 17: a17 [-] 1 list: <address>*1 18: a18 ------------------- [-] 1 list: <address>*1 19: a19 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 20: a20 --------------------- [-] 1 list: <address>*1 21: a21 [-] 1 list: <address>*1 22: a22 ----------------------- [-] 1 list: <address>*1 23: a23 [-] 1 list: <address>*1 24: a24 ------------------------- [-] 1 list: <address>*1 25: a25 [-] 1 list: <address>*1 26: a26 --------------------------- [-] 1 list: <address>*1 27: a27 [-] 1 list: <address>*1 28: a28 ----------------------------- [-] 1 list: <address>*1 29: a29 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 20: a20 --------------------- [-] 1 list: <address>*1 21: a21 [-] 1 list: <address>*1 22: a22 ----------------------- [-] 1 list: <address>*1 23: a23 [-] 1 list: <address>*1 24: a24 ------------------------- [-] 1 list: <address>*1 25: a25 [-] 1 list: <address>*1 26: a26 --------------------------- [-] 1 list: <address>*1 27: a27 [-] 1 list: <address>*1 28: a28 ----------------------------- [-] 1 list: <address>*1 29: a29 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 30: a30 ------------------------------- [-] 1 list: <address>*1 31: a31 [R] 1 tuple: <address>*1 30: a30 ------------------------------- [-] 1 list: <address>*1 31: a31 [R] 1 tuple: <address>*1 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [-] 1 list: <address>*1 3: a3 [-] 1 list: <address>*1 4: a4 ------ [-] 1 list: <address>*1 5: a5 [-] 1 list: <address>*1 6: a6 -------- [-] 1 list: <address>*1 7: a7 [-] 1 list: <address>*1 8: a8 ---------- [-] 1 list: <address>*1 9: a9 [-] 1 list: <address>*1 <22 more lines. Type e.g. '_.more' for more.> 10: a10 ----------- [-] 1 list: <address>*1 11: a11 [-] 1 list: <address>*1 12: a12 ------------- [-] 1 list: <address>*1 13: a13 [-] 1 list: <address>*1 14: a14 --------------- [-] 1 list: <address>*1 15: a15 [-] 1 list: <address>*1 16: a16 ----------------- [-] 1 list: <address>*1 17: a17 [-] 1 list: <address>*1 18: a18 ------------------- [-] 1 list: <address>*1 19: a19 [-] 1 list: <address>*1 <12 more lines. Type e.g. '_.more' for more.> Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [-] 1 list: <address>*1 3: a3 [-] 1 list: <address>*1 4: a4 ------ [-] 1 list: <address>*1 5: a5 [-] 1 list: <address>*1 6: a6 -------- [-] 1 list: <address>*1 7: a7 [-] 1 list: <address>*1 8: a8 ---------- [-] 1 list: <address>*1 9: a9 [-] 1 list: <address>*1 10: a10 ----------- [+] 1 list: <address>*1 Reference Pattern by <[dict of] class>. 0: _ --- [-] 1 list: <address>*0 1: a [-] 1 list: <address>*1 2: aa ---- [-] 1 list: <address>*1 3: a3 [-] 1 list: <address>*1 4: a4 ------ [-] 1 list: <address>*1 5: a5 [-] 1 list: <address>*1 6: a6 -------- [-] 1 list: <address>*1 7: a7 [-] 1 list: <address>*1 8: a8 ---------- [-] 1 list: <address>*1 9: a9 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 10: a10 ----------- [-] 1 list: <address>*1 11: a11 [-] 1 list: <address>*1 12: a12 ------------- [-] 1 list: <address>*1 13: a13 [-] 1 list: <address>*1 14: a14 --------------- [-] 1 list: <address>*1 15: a15 [-] 1 list: <address>*1 16: a16 ----------------- [-] 1 list: <address>*1 17: a17 [-] 1 list: <address>*1 18: a18 ------------------- [-] 1 list: <address>*1 19: a19 [-] 1 list: <address>*1 <Type e.g. '_.more' for more.> 10: a10 ----------- [-] 1 list: <address>*1 11: a11 [-] 1 list: <address>*1 12: a12 ------------- [-] 1 list: <address>*1 13: a13 [-] 1 list: <address>*1 14: a14 --------------- [-] 1 list: <address>*1 15: a15 [-] 1 list: <address>*1 16: a16 ----------------- [-] 1 list: <address>*1 17: a17 [-] 1 list: <address>*1 18: a18 ------------------- [-] 1 list: <address>*1 19: a19 [-] 1 list: <address>*1 20: a20 --------------------- [+] 1 list: <address>*1 )N)�io�StringIOr r r r r2 Zmore�str�top�prevr r) �getvalue)r r �Rr4 r r r, r �mZm1Zm2r )r0 r r1 r �test_presentationt sT %zRefPatCase.test_presentationc C s| dd l }g }|g}|g}|f}|g}||g}| �||�}| �|jj|� |�� | �|jj|� | �|jj| d |� d S )Nr ) �gcr r'