3
ßL]ˆ  ã               @   sf   d dl mZmZmZ d dlZd dlZd dlZd dlm	Z	m
Z
 ddlmZ dd„ ZG dd	„ d	ejƒZdS )
é    )ÚdivisionÚabsolute_importÚprint_functionN)Úassert_raisesÚassert_equalé   )Úutilc              G   s   t jjt jjtƒf|  Ž S )N)ÚosÚpathÚjoinÚdirnameÚ__file__)Úa© r   úB/tmp/pip-install-q_7g0qgj/Numpy/numpy/f2py/tests/test_parameter.pyÚ_path   s    r   c               @   sÒ   e Zd ZedddƒedddƒedddƒedddƒedddƒgZejjdd	„ ƒZejjd
d„ ƒZ	ejjdd„ ƒZ
ejjdd„ ƒZejjdd„ ƒZejjdd„ ƒZejjdd„ ƒZejjdd„ ƒZejjdd„ ƒZdS )ÚTestParametersÚsrcÚ	parameterzconstant_real.f90zconstant_integer.f90zconstant_both.f90zconstant_compound.f90zconstant_non_compound.f90c             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|d	ddgƒ d S )
Né   )Údtypeé   é   r   r   r   r   é   )ÚnpÚarangeZfloat32r   Ú
ValueErrorÚmoduleZ
foo_singler   )ÚselfÚxr   r   r   Útest_constant_real_single   s
    z(TestParameters.test_constant_real_singlec             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|d	ddgƒ d S )
Nr   )r   r   r   r   r   r   r   r   )r   r   Úfloat64r   r   r   Z
foo_doubler   )r   r   r   r   r   Útest_constant_real_double$   s
    z(TestParameters.test_constant_real_doublec             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|d	ddgƒ d S )
Nr   )r   r   r   r   r   r   é   é   )r   r   Úint32r   r   r   Zfoo_compound_intr   )r   r   r   r   r   Útest_constant_compound_int/   s
    z)TestParameters.test_constant_compound_intc             C   s2   t jdt jd�}| jj|ƒ t|d
dddgƒ d S )Né   )r   r   r   r   r   r   r   r#   é   )r   r   r%   r   Zfoo_non_compound_intr   )r   r   r   r   r   Útest_constant_non_compound_int:   s    z-TestParameters.test_constant_non_compound_intc             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|d	ddgƒ d S )
Nr   )r   r   r   r   r   r   r   r   )r   r   r%   r   r   r   Zfoo_intr   )r   r   r   r   r   Útest_constant_integer_intA   s
    z(TestParameters.test_constant_integer_intc             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|d	ddgƒ d S )
Nr   )r   r   r   r   r   r   r   r   )r   r   Zint64r   r   r   Zfoo_longr   )r   r   r   r   r   Útest_constant_integer_longL   s
    z)TestParameters.test_constant_integer_longc             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|dddgƒ d S )Nr   )r   r   r   r   r   r   é	   r,   r   é   é   r   r   )r   r   r!   r   r   r   Zfoor   )r   r   r   r   r   Útest_constant_bothW   s
    z!TestParameters.test_constant_bothc             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|dddgƒ d S )Nr   )r   r   r   r   r   r   r,   r,   r   r-   r.   r   r   )r   r   r!   r   r   r   Zfoo_nor   )r   r   r   r   r   Útest_constant_nob   s
    zTestParameters.test_constant_noc             C   sZ   t jdt jd�d d d… }tt| jj|ƒ t jdt jd�}| jj|ƒ t|dddgƒ d S )Nr   )r   r   r   r   r   r   r,   r,   r   r-   r.   r   r   )r   r   r!   r   r   r   Zfoo_sumr   )r   r   r   r   r   Útest_constant_summ   s
    z TestParameters.test_constant_sumN)Ú__name__Ú
__module__Ú__qualname__r   ÚsourcesÚpytestÚmarkZslowr    r"   r&   r)   r*   r+   r/   r0   r1   r   r   r   r   r      s   



r   )Ú
__future__r   r   r   r	   r6   Znumpyr   Znumpy.testingr   r   Ú r   r   ZF2PyTestr   r   r   r   r   Ú<module>   s   