o
    >~#g                     @   s   d dl Z d dlZd dlZd dlZd dlmZ ddlm	Z	 G dd de	j
ZG dd de	j
ZG dd	 d	e	j
Zd
d ZG dd de	j
ZG dd de	j
ZG dd de	j
Zejjdd Zejjejje dvdddd ZdS )    N   )utilc                   @   .   e Zd ZeddddgZejjdd Z	dS )TestIntentInOuttestssrc
regression	inout.f90c                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds.J d S )N   dtype      )r   r   r   )	nparangefloat32pytestraises
ValueErrormodulefooallclose)selfx r   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/numpy/f2py/tests/test_regression.py
test_inout   s
   zTestIntentInOut.test_inoutN)
__name__
__module____qualname__r   getpathsourcesr   markslowr   r   r   r   r   r          r   c                   @   r   )TestNegativeBoundsr   r   negative_boundszissue_20853.f90c                 C   s^   t d}d}d}dd }| jj|||d ||| d}t jdt jd}t ||s-J d S )	N   i   c                 S   s   ||  d S )Nr   r   )xlxhr   r   r   ubound&   s   z0TestNegativeBounds.test_negbound.<locals>.ubound)is_ie_arr   r   )r   r   r   r   r   r   )r   xvecxlowxhighr+   rvalexpvalr   r   r   test_negbound   s   

z TestNegativeBounds.test_negboundN)
r   r   r   r   r    r!   r   r"   r#   r5   r   r   r   r   r%      r$   r%   c                   @   r   )TestNumpyVersionAttributer   r   r   r	   c                 C   s8   t | jdsJ t| jjtsJ tj| jjksJ d S )N__f2py_numpy_version__)hasattrr   
isinstancer7   strr   __version__)r   r   r   r   test_numpy_version_attribute3   s   z6TestNumpyVersionAttribute.test_numpy_version_attributeN)
r   r   r   r   r    r!   r   r"   r#   r<   r   r   r   r   r6   .   s    r6   c                  C   s.   t j } t| }dD ]}||v sJ qd S )N)zfortranobject.czfortranobject.h)r   f2pyget_includeoslistdir)incdirfnames_in_dirfnamer   r   r   test_include_path@   s
   

rD   c                   @   sV   e Zd ZeddddgZdeddd deddd gZejj	dd Z
d	S )
TestIncludeFilesr   r   r   zincfile.f90z-Iz--include-paths c                 C   s"   d}| j dd}||ksJ d S )Ng      @g      @g      @)r   add)r   expresr   r   r   test_gh25344L   s   zTestIncludeFiles.test_gh25344N)r   r   r   r   r    r!   optionsr   r"   r#   rI   r   r   r   r   rE   G   s    rE   c                   @   s>   e Zd ZeddddgZejjdd Z	ejjdd Z
d	S )
TestF77Commentsr   r   r   zf77comments.fc                 C   R   t jdt jd}t jdt jd}| j||}|d dksJ |d dks'J d S Nr   r      r      r      r   arrayint32r   testsubr   x1x2rH   r   r   r   test_gh26148V   
   zTestF77Comments.test_gh26148c                 C   s0   t jddt jdd }| j }t|| d S )Nr   r/   r   r   )r   r   r   r   testsub2nptassert_allclose)r   expectedrH   r   r   r   test_gh26466^   s   
zTestF77Comments.test_gh26466N)r   r   r   r   r    r!   r   r"   r#   rX   r^   r   r   r   r   rK   R   s    
rK   c                   @   r   )TestF90Contiuationr   r   r   f90continuation.f90c                 C   rL   rM   rQ   rU   r   r   r   test_gh26148bi   rY   z TestF90Contiuation.test_gh26148bN)
r   r   r   r   r    r!   r   r"   r#   ra   r   r   r   r   r_   e   r$   r_   c               
   C   s^   zt jt ddddgdgdd} W d S  ty. } zdt|vs#J W Y d }~d S d }~ww )	Nr   r   r   r`   z	-lfoo.barBlah)module_namezlparen got assign)r   build_moduler    RuntimeErrorr:   aarerrr   r   r   test_gh26623q   s   ri   )LinuxDarwinz$Unsupported on this platform for now)reasonc               
   C   s`   zt jt ddddgddgdd} W d S  ty/ } zd	t|v s$J W Y d }~d S d }~ww )
Nr   r   r   zf77fixedform.f95z--f77flags='-ffixed-form -O2'z--f90flags="-ffixed-form -Og"rb   )rJ   rc   unknown_subroutine_)r   rd   r    ImportErrorr:   rf   r   r   r   test_gh25784~   s   	ro   )r?   r   platformnumpyr   numpy.testingtestingr[    r   F2PyTestr   r%   r6   rD   rE   rK   r_   r"   r#   ri   skipifsystemro   r   r   r   r   <module>   s$    
