
    G/PhU                        d dl Z d dlZd dlmZmZmZ d dlZd dlm	Z	 e j
        j         G d de	j                              Z G d de	j                  Z G d d	e	j                  Z G d
 de	j                  Z G d de	j                  Ze j
        j         G d de	j                              Ze j
        j         G d de	j                              Ze j
        j         G d de	j                              ZdS )    N)assert_array_equalassert_equalassert_raises)utilc                   2   e Zd ZdZdZg dZdZeD ]ZeZ e	d          
                    ee          Ze ej        d                    g de de d	e d
e de de de d	e de de de de de de de de de de de de de de de de de d                    z  Zej                            de          d             Zej                            dedd                   d             Zej                            de          d             Zej                            de          d             Zej                            de          d             ZdS )TestCharacterString.f90test_character_string13star (*))r   z

        subroutine _input_z(c, o, n)
          character*z, intent(in) :: c
          integer n
          !f2py integer, depend(c), intent(hide) :: n = slen(c)
          integer*1, dimension(n) :: o
          !f2py intent(out) o
          o = transfer(c, o)
        end subroutine _output_z, intent(out) :: c
          integer n
          integer*1, dimension(n), intent(in) :: o
          !f2py integer, depend(o), intent(hide) :: n = len(o)
          c = transfer(o, c)
        end subroutine _array_input_z;(c, o, m, n)
          integer m, i, n
          character*aH  , intent(in), dimension(m) :: c
          !f2py integer, depend(c), intent(hide) :: m = len(c)
          !f2py integer, depend(c), intent(hide) :: n = f2py_itemsize(c)
          integer*1, dimension(m, n), intent(out) :: o
          do i=1,m
            o(i, :) = transfer(c(i), o(i, :))
          end do
        end subroutine _array_output_z!(c, o, m, n)
          character*a  , intent(out), dimension(m) :: c
          integer n
          integer*1, dimension(m, n), intent(in) :: o
          !f2py character(f2py_len=n) :: c
          !f2py integer, depend(o), intent(hide) :: m = len(o)
          !f2py integer, depend(o), intent(hide) :: n = shape(o, 1)
          do i=1,m
            c(i) = transfer(o(i, :), c(i))
          end do
        end subroutine _2d_array_input_zH(c, o, m1, m2, n)
          integer m1, m2, i, j, n
          character*a  , intent(in), dimension(m1, m2) :: c
          !f2py integer, depend(c), intent(hide) :: m1 = len(c)
          !f2py integer, depend(c), intent(hide) :: m2 = shape(c, 1)
          !f2py integer, depend(c), intent(hide) :: n = f2py_itemsize(c)
          integer*1, dimension(m1, m2, n), intent(out) :: o
          do i=1,m1
            do j=1,m2
              o(i, j, :) = transfer(c(i, j), o(i, j, :))
            end do
          end do
        end subroutine z	
        lengthc                 (   ddi                     ||          }t          | j        | j        dz   |z             }dddd|         }t	           ||          t          j        t          t          t          |                    d	                     d S )
Nr   r   r   aabcabcdeabcdeabcder   u1dtype)
getgetattrmodulefprefixr   nparraylistmapordselfr   fsuffixfr   s        _/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpy/f2py/tests/test_character.py
test_inputzTestCharacterString.test_inputM   s    &/%%ff55DK	!9G!CDDE;77?11Q44$s3{{*;*;4!H!H!HIIIII    Nc                    |}t          | j        | j        dz   |z             }ddd|         }t           |t	          j        t          t          t          |                    d                    |	                                           d S )Nr   r   r   )r   r   r   r   )
r   r    r!   r   r"   r#   r$   r%   r&   encoder'   s        r+   test_outputzTestCharacterString.test_outputV   s    DK
!:W!DEEE""6*11RXd3sA;;&7&7tDDDEE88::	' 	' 	' 	' 	'r-   c                    |}t          | j        | j        dz   |z             }t          j        dddd|         dddd|         gd	
          }t          j        d |D             d
          }t           ||          |           d S )Nr   r   r   r   r   AABCABCDEABCDEABCDESr   c                 &    g | ]}d  |D             S )c                     g | ]}|S  r9   .0cs     r+   
<listcomp>zCTestCharacterString.test_array_input.<locals>.<listcomp>.<listcomp>i   s    ^^^Aa^^^r-   r9   r;   ss     r+   r=   z8TestCharacterString.test_array_input.<locals>.<listcomp>i   s"    777^^^^^777r-   r   r   r    r!   r"   r#   r   r(   r   r)   r*   r   expecteds         r+   test_array_inputz$TestCharacterString.test_array_input`   s    DK!?'!IJJHCe[AA&Ie[AA&I"$ $ $ 877Q777tDDD11Q44*****r-   c                    |}t          | j        | j        dz   |z             }t          j        dddd|         dddd|         gd	
          }t          j        d |D             d
          }t           ||          |           d S )Nr   r   r   r   r   r3   r4   r5   r6   r   c                 &    g | ]}d  |D             S )c                     g | ]}|S r9   r9   r:   s     r+   r=   zDTestCharacterString.test_array_output.<locals>.<listcomp>.<listcomp>u   s    nnnQqnnnr-   r9   r>   s     r+   r=   z9TestCharacterString.test_array_output.<locals>.<listcomp>u   s"    777nn!nnn777r-   r   r@   )r(   r   r)   r*   rB   r   s         r+   test_array_outputz%TestCharacterString.test_array_outputl   s    DK0@!@7!JKK8UK88@UK88@BILN N N H77h777tDDD11Q44*****r-   c                 F   |}t          | j        | j        dz   |z             }t          j        dddd|         dddd|         gd	d
dd|         dddd|         ggd          }t          j        d |D             dd          }t           ||          |           d S )Nr   r   r   r   r   r3   r4   r5   r*   fghfghijfghijfghijFFGHFGHIJFGHIJFGHIJr6   r   c                 &    g | ]}d  |D             S )c                 &    g | ]}d  |D             S )c                     g | ]}|S r9   r9   r:   s     r+   r=   zQTestCharacterString.test_2d_array_input.<locals>.<listcomp>.<listcomp>.<listcomp>   s    ///Qq///r-   r9   )r;   items     r+   r=   zFTestCharacterString.test_2d_array_input.<locals>.<listcomp>.<listcomp>   s'    @@@D//$///@@@r-   r9   )r;   rows     r+   r=   z;TestCharacterString.test_2d_array_input.<locals>.<listcomp>   s'    NNNS@@C@@@NNNr-   r   r   orderr@   rA   s         r+   test_2d_array_inputz'TestCharacterString.test_2d_array_inputx   s    DK0B!BW!LMMHSukBB6J ukBB6JL ukBB6J ukBB6JLM 	     
 8NNANNN"&c3 3 311Q44*****r-   )__name__
__module____qualname__suffixr!   length_listcoder   r)   dictr   clengthtextwrapdedentjoinpytestmarkparametrizer,   r1   rC   rG   rU   r9   r-   r+   r   r      s        F%G$$$KD ; ;$E"""&&vv66 7! 7! 7! 7! 7! 7!7! 7! 7! 7!$+7! 7! 7! 7! 7! 7! 7! 7!  7! 7! 7! 7! )07! 7! 7! 7! 7! 7! 7! 7! &-7! 7! 7! 7! 7! 7! 7! 7!"  #7! 7! 7! 7!" *1#7! 7! 7! 7!& '7! 7! 7! 7!& +2'7! 7! 7! 7!* +7! 7! 7! 7!8  97! 7! 7! 7!8 /697! 7! 7! 7!< =7! 7! 7! 7!< ,3=7! 7! 7! 7!> ?7! 7! 7! 7!P  Q7! 7! 7! 7!P 07Q7! 7! 7! 7!T U7! 7! 7! 7!T .5U7! 7! 7! 7!X Y7! 7! 7! 7!l  m7! 7! 7! 7!l 29m7! 7! 7! 7! 7! 7! 7 7 7	r [X{33J J 43J [X{3B3'788' ' 98' [X{33	+ 	+ 43	+ [X{33	+ 	+ 43	+ [X{33+ + 43+ + +r-   r   c                      e Zd ZdZdZ ej        d                    g de de de de de d	e d
e de de de de de de de de de de de de de de de de de d                    Ze	j
                            dddg          d              Zd! Ze	j
                            dg d"          d#             Zd$ Ze	j
                            dg d"          d%             Zd& Zd' Zd( Ze	j
                            dddg          d)             Zd* Ze	j
                            dddg          d+             Ze	j
                            dddg          d,             Zd- Ze	j
                            d.          d/             Zd0 Zd1S )2TestCharacterr	   test_characterr   
       subroutine z_input(c, o)
          character, intent(in) :: c
          integer*1 o
          !f2py intent(out) o
          o = transfer(c, o)
       end subroutine z_input

       subroutine z_output(c, o)
          character :: c
          integer*1, intent(in) :: o
          !f2py intent(out) c
          c = transfer(o, c)
       end subroutine z_output

       subroutine z_input_output(c, o)
          character, intent(in) :: c
          character o
          !f2py intent(out) o
          o = c
       end subroutine z!_input_output

       subroutine z_inout(c, n)
          character :: c, n
          !f2py intent(in) n
          !f2py intent(inout) c
          c = n
       end subroutine z_inout

       function z_return(o) result (c)
          character :: c
          character, intent(in) :: o
          c = transfer(o, c)
       end function z_return

       subroutine z_array_input(c, o)
          character, intent(in) :: c(3)
          integer*1 o(3)
          !f2py intent(out) o
          integer i
          do i=1,3
            o(i) = transfer(c(i), o(i))
          end do
       end subroutine z _array_input

       subroutine a'  _2d_array_input(c, o)
          character, intent(in) :: c(2, 3)
          integer*1 o(2, 3)
          !f2py intent(out) o
          integer i, j
          do i=1,2
            do j=1,3
              o(i, j) = transfer(c(i, j), o(i, j))
            end do
          end do
       end subroutine z#_2d_array_input

       subroutine z_array_output(c, o)
          character :: c(3)
          integer*1, intent(in) :: o(3)
          !f2py intent(out) c
          do i=1,3
            c(i) = transfer(o(i), c(i))
          end do
       end subroutine z!_array_output

       subroutine z_array_inout(c, n)
          character :: c(3), n(3)
          !f2py intent(in) n(3)
          !f2py intent(inout) c(3)
          do i=1,3
            c(i) = n(i)
          end do
       end subroutine z _array_inout

       subroutine a   _2d_array_inout(c, n)
          character :: c(2, 3), n(2, 3)
          !f2py intent(in) n(2, 3)
          !f2py intent(inout) c(2. 3)
          integer i, j
          do i=1,2
            do j=1,3
              c(i, j) = n(i, j)
            end do
          end do
       end subroutine z!_2d_array_inout

       function z_array_return(o) result (c)
          character, dimension(3) :: c
          character, intent(in) :: o(3)
          do i=1,3
            c(i) = o(i)
          end do
       end function z_array_return

       function z_optional(o) result (c)
          character, intent(in) :: o
          !f2py character o = "a"
          character :: c
          c = o
       end function z_optional
    r   r<   S1c                    t          | j        | j        dz             }t           |t	          j        d|                    t          d                     t           |t	          j        d|                    t          d                     t           |t	          j        dg|                    t          d                     t           |t	          j        d|                    t          d                     t           |t	          j        dgg|                    t          d                     d S )N_inputr   r      ar   )r   r    r!   r   r"   r#   r&   r(   r   r*   s      r+   r,   zTestCharacter.test_input   s   DK!899QQrx511122CHH===QQrxE22233SXX>>>QQrxU33344c#hh???QQrxU33344c#hh???QQrx#u55566CAAAAAr-   c                    t          | j        | j        dz             }t           |d          t	          d                     t           |d          t	          d                     t           |d          d           t           |d          d           t           |d          d           t           |d          t	          d                     t           |d	          t	          d                     t           |dg          t	          d                     t           |t          j        d                    t	          d                     t           |t          j        dg                    t	          d                     t          j        d          }t           ||          t	          d                     t          j        dg          }t           ||          t	          d                     	  |g            t          |j         d
          # t          $ r-}t          |                              d          s Y d }~nd }~ww xY w	  |d           t          |j         d          # t          $ r.}t          |                              d          s Y d }~d S d }~ww xY w)Nrj   r   rk   r   r   r-       abs   abz! should have failed on empty listz got 0-lista   z  should have failed on int valuez got int instance)r   r    r!   r   r&   r"   r#   SystemErrorrV   
IndexErrorstrendswith	TypeErrorr(   r*   r   msgs       r+   test_input_variazTestCharacter.test_input_varia   s   DK!899QQsVVSXX&&&QQtWWc$ii(((QQrUUAQQsVVQQQuXXq!!!QQtWWc#hh'''QQuXXs3xx(((QQuXXs3xx(((QQrx~~&&C111QQrx''((#c((333HSMMQQqTT3s88$$$HcUOOQQqTT3s88$$$	PAbEEE
 NNNOOO	  	 	 	s88$$]33     		OAbEEE
 MMMNNN	  	 	 	s88$$%899      	s0   H1 1
I(;#I##I(,J 
K#KK)r<   rh   U1c                    t          | j        | j        dz             }t           |t	          j        g d|                    t	          j        t          t          t          d                    d                     t           |t	          j        g d|                    t	          j        t          t          t          d                    d                     d S )N_array_inputr   br<   r   r   i1rk      b   c)	r   r    r!   r   r"   r#   r$   r%   r&   rl   s      r+   rC   zTestCharacter.test_array_input   s    DK!>??11RXoooUCCCDD8DS%$9$9FFF	H 	H 	H11RX&8&8&8FFFGG8DS%$9$9FFF	H 	H 	H 	H 	Hr-   c                 8   t          | j        | j        dz             }t           |g d          t	          j        t          t          t          d                    d                     t           |g d          t	          j        t          t          t          d                    d                     	  |g d           t          |j
         d          # t          $ r.}t          |                              d	          s Y d }~d S d }~ww xY w)
Nr{   r|   r   r~   r   r   r   r}   r<   d" should have failed on wrong input)th dimension must be fixed to 3 but got 4)r   r    r!   r   r"   r#   r$   r%   r&   rq   rV   
ValueErrorrs   rt   )r(   r*   rw   s      r+   test_array_input_variaz$TestCharacter.test_array_input_varia)  sR   DK!>??11___--8DS%$9$9FFF	H 	H 	H11///008DS%$9$9FFF	H 	H 	H	CA"""### :AAAC C C  	 	 	s88$$?A A      	s   =C! !
D+#DDc                    t          | j        | j        dz             }t          j        g dg dg|d          }|                    |dk    rt          j        nt          j                  }t           ||          |           d S )N_2d_array_inputr|   r   er*   rK   rS   ry   )	r   r    r!   r"   r#   viewuint32uint8r   )r(   r   r*   r   rB   s        r+   rU   z!TestCharacter.test_2d_array_input:  s    DK0A!ABBHooo%oo'.33@ @ @66u}}"))"(CC11Q44*****r-   c                     t          | j        | j        dz             }t           |t	          d                    d           t           |d          d           d S )N_outputrk   r   rn   )r   r    r!   r   r&   r(   r*   s     r+   r1   zTestCharacter.test_outputC  sV    DK	!9::QQs4yy\\4(((QQqTT5!!!!!r-   c           
          t          | j        | j        dz             }t           |t	          t          t          d                              t          j        t	          d          d                     d S )N_array_outputr   rh   r   )	r   r    r!   r   r$   r%   r&   r"   r#   r   s     r+   rG   zTestCharacter.test_array_outputI  sj    DK!?@@11T#c5//22338DKKt<<<	> 	> 	> 	> 	>r-   c                     t          | j        | j        dz             }t           |d          d           t           |d          d           t           |d          d           d S )N_input_outputrk   r   r   rn   r   r    r!   r   r   s     r+   test_input_outputzTestCharacter.test_input_outputO  sh    DK!?@@QQtWWd###QQsVVT"""QQrUUE"""""r-   c                 8   t          | j        | j        dz             }t          j        t          d          |          } ||d           t          |t          j        t          d          |j                              ||dd          d           t          |t          j        t          d          |j                             t          j        dg|          } ||d           t          |t          j        dg|j                             d S )	N_inoutr   r   r3   Abc   BABc)r   r    r!   r"   r#   r$   r   r   )r(   r   r*   r   s       r+   
test_inoutzTestCharacter.test_inoutV  s    DK!899HT%[[...	!S			1bhtE{{!'BBBCCC	!ABB%1bhtE{{!'BBBCCCHeWE***	!S			1bhwag>>>?????r-   c                 *   t          | j        | j        dz             }t          j        dd          } ||d           t          |t          j        d|j                             t          j        dgd          } ||d           t          |t          j        dg|j                             	  |dd           t          |j         d          # t          $ r.}t          |                              d          s Y d }~d S d }~ww xY w)	Nr   r   S3r   r3   r   z  should have failed on str valuez
 got 3-str)r   r    r!   r"   r#   r   r   rq   rV   r   rs   rt   rv   s       r+   test_inout_variazTestCharacter.test_inout_variad  s4   DK!899HU$'''	!S			1bhuAG<<<===HeWD)))	!S			1bhwag>>>???	OAeSMMM
 MMMNNN	  	 	 	s88$$\22      	s   7C 
D$#DDc                    t          | j        | j        dz             }t          j        g d|d          }t          j        g d|d          } |||           t          ||           t          j        g d|          } ||dd          |           t          |t          j        g d	|                     t          j        g dg|d          } |||           t          |t          j        g dg|                     t          j        g d|d          }	  |||           t          |j         d
          # t          $ r.}t          |          
                    d          s Y d }~d S d }~ww xY w)N_array_inoutr3   r   CrK   rS   r|   r   r   r   )r   r3   r   r   r   r   )r   r    r!   r"   r#   r   rq   rV   r   rs   rt   )r(   r   r*   nr   rw   s         r+   test_array_inoutzTestCharacter.test_array_inoutv  s   DK!>??H___E===H___E===	!Q1a   H)))777	!ABB%1bh';';';5IIIJJJHooo&e3???	!Q1bh'8FFFGGGH)))cBBB	CAaGGG :AAAC C C  	 	 	s88$$?A A      	s   %E 
F #E;;F c                     t          | j        | j        dz             }t          j        g dg dg|d          }t          j        g dg dg|d          } |||           t          ||           d S )N_2d_array_inoutr   )DErK   rK   rS   r|   r   r@   )r(   r   r*   r   r   s        r+   test_2d_array_inoutz!TestCharacter.test_2d_array_inout  s    DK0A!ABBHooo%oo' - - - Hooo%oo' - - - 	
!Q1a     r-   c                 r    t          | j        | j        dz             }t           |d          d           d S )N_returnr   rk   r   r   s     r+   test_returnzTestCharacter.test_return  s8    DK	!9::QQsVVT"""""r-   z*fortran function returning array segfaultsc                     t          | j        | j        dz             }t          j        t          d          d          }t           ||          |           d S )N_array_returnr   rh   r   )r   r    r!   r"   r#   r$   r   )r(   r*   r   s      r+   test_array_returnzTestCharacter.test_array_return  sR    DK!?@@HT%[[---11Q44#####r-   c                     t          | j        | j        dz             }t           |            d           t           |d          d           d S )N	_optionalrk      Br   r   s     r+   test_optionalzTestCharacter.test_optional  sN    DK!;<<QQSS$QQtWWd#####r-   N)rV   rW   rX   rY   r!   r^   r_   r`   r[   ra   rb   rc   r,   rx   rC   r   rU   r1   rG   r   r   r   r   r   r   skipr   r   r9   r-   r+   re   re      s&       FG8? e e e e e ee e e e e e e e e e e e e e e e e e e e( )e e e e, -e e e e6 7e e e e: ;e e e eB Ce e e eF Ge e e eV We e e eZ [e e e en oe e e er se e e e@ Ae e e eD Ee e e eR Se e e eV We e e ej ke e e en oe e e ez {e e e e~ e e e eH Ie e e e e e e	 e	DN [WsDk22B B 32B!O !O !OF [W&7&7&788H H 98HC C C" [W&7&7&788+ + 98+" " "> > ># # # [WsDk22@ @ 32@O O O$ [WsDk22C C 32C6 [WsDk22	! 	! 32	!# # #
 [BCC$ $ DC$$ $ $ $ $r-   re   c                      e Zd ZdZdZ ej        de de de de de de d	e d
e de de de de d          Zej	        j
        d             Zd Zd Zd Zej	                            dddg          d             ZdS )TestMiscCharacterr	   test_misc_characterrg   a(  _gh18684(x, y, m)
         character(len=5), dimension(m), intent(in) :: x
         character*5, dimension(m), intent(out) :: y
         integer i, m
         !f2py integer, intent(hide), depend(x) :: m = f2py_len(x)
         do i=1,m
           y(i) = x(i)
         end do
       end subroutine z_gh18684

       subroutine z_gh6308(x, i)
         integer i
         !f2py check(i>=0 && i<12) i
         character*5 name, x
         common name(12)
         name(i + 1) = x
       end subroutine z_gh6308

       subroutine z_gh4519(x)
         character(len=*), intent(in) :: x(:)
         !f2py intent(out) x
         integer :: i
         ! Uncomment for debug printing:
         !do i=1, size(x)
         !   print*, "x(",i,")=", x(i)
         !end do
       end subroutine z_gh4519

       pure function aq  _gh3425(x) result (y)
         character(len=*), intent(in) :: x
         character(len=len(x)) :: y
         integer :: i
         do i = 1, len(x)
           j = iachar(x(i:i))
           if (j>=iachar("a") .and. j<=iachar("z") ) then
             y(i:i) = achar(j-32)
           else
             y(i:i) = x(i:i)
           endif
         end do
       end function z_gh3425

       subroutine aO  _character_bc_new(x, y, z)
         character, intent(in) :: x
         character, intent(out) :: y
         !f2py character, depend(x) :: y = x
         !f2py character, dimension((x=='a'?1:2)), depend(x), intent(out) :: z
         character, dimension(*) :: z
         !f2py character, optional, check(x == 'a' || x == 'b') :: x = 'a'
         !f2py callstatement (*f2py_func)(&x, &y, z)
         !f2py callprotoargument character*, character*, character*
         if (y.eq.x) then
           y = x
         else
           y = 'e'
         endif
         z(1) = 'c'
       end subroutine z%_character_bc_new

       subroutine aG  _character_bc_old(x, y, z)
         character, intent(in) :: x
         character, intent(out) :: y
         !f2py character, depend(x) :: y = x[0]
         !f2py character, dimension((*x=='a'?1:2)), depend(x), intent(out) :: z
         character, dimension(*) :: z
         !f2py character, optional, check(*x == 'a' || x[0] == 'b') :: x = 'a'
         !f2py callstatement (*f2py_func)(x, y, z)
         !f2py callprotoargument char*, char*, char*
          if (y.eq.x) then
           y = x
         else
           y = 'e'
         endif
         z(1) = 'c'
       end subroutine z_character_bc_old
    c                     t          | j        | j        dz             }t          j        ddgd          } ||          }t          ||           d S )N_gh18684abcdefghijS5r   r@   )r(   r*   xys       r+   test_gh18684zTestMiscCharacter.test_gh18684  sX     DK
!:;;Hgw't444AaDD1a     r-   c                    t          | j        | j        dz             }t          | j        j        j        j        t          j        d                     t          t          | j        j        j                  d            |dd           t          | j        j        j        d         d            |dd           t          | j        j        j        d         d	           d S )
N_gh6308r      r   r   s   abcde12345   s   12345)	r   r    r!   r   _BLNK_namer   r"   lenr   s     r+   test_gh6308zTestMiscCharacter.test_gh6308  s    DK	!9::T[',2BHTNNCCCS+0112666	'1T[',Q/:::	'1T[',Q/:::::r-   c                 r   t          | j        | j        dz             }dt          dt	          j        d                    fdt          dt	          j        d                    ft	          j        g dd	          t          d
t	          j        d                    fg dt          d
t	          j        d                    fddgt          dt	          j        d                    ffD ]H\  }} ||          }|                                D ]#\  }}t          t          ||          |           $Id S )N_gh4519r   r9   rh   )shaper   textS4)r   2r   r   )   )r   r   34S2r   )   )	r   r    r!   r\   r"   r   r#   itemsr   )r(   r*   r   rB   rkvs          r+   test_gh4519zTestMiscCharacter.test_gh4519  s<   DK	!9:: d28D>>:::;Bbhtnn===>///666D7779!!!D7779b4d"(4..AAABD 
	/ 
	/KAx !A (( / /1WQ]]A..../
	/ 
	/r-   c                     t          | j        | j        dz             }t           |d          d           t           |d          d           t           |d          d           d S )N_gh3425abCs   ABCr   r-   abC12ds   ABC12Dr   r   s     r+   test_gh3425zTestMiscCharacter.test_gh3425(  sj    DK	!9:: 	QQuXXv&&&QQrUUC   QQx[[),,,,,r-   statenewoldc                 b   t          | j        | j        dz   |z                          \  }}t          |d           t          t	          |          d            d          \  }}t          |d           t          t	          |          d           t          t          fd           d S )N_character_bc_rk   r   r   r   c                        d          S )Nr   r9   )r*   s   r+   <lambda>z5TestMiscCharacter.test_character_bc.<locals>.<lambda>=  s    4 r-   )r   r    r!   r   r   r   	Exception)r(   r   r<   r   r*   s       @r+   test_character_bcz#TestMiscCharacter.test_character_bc1  s    DK0@!@5!HIIqss1QSVVQqww1QSVVQi11111r-   N)rV   rW   rX   rY   r!   r^   r_   r[   ra   rb   slowr   r   r   r   rc   r   r9   r-   r+   r   r     s       F#G8? LL L L L L L" #L L& 'L L6 7L L: ;L LR SL LV WL Lt uL Lx yL LV WL L L L	 L	D\ [! ! !	; 	; 	;/ / / - - - [Wuen552 2 652 2 2r-   r   c                   B    e Zd Z ej        dddd          gZd Zd ZdS )TestStringScalarArrtestssrcstringzscalar_string.f90c                     | j         j        j        | j         j        j        fD ] }d}|j        |k    sJ d}|j        |k    sJ !d S )Nr9   z|S8)r    string_testr   string77r   r   r(   outrB   s      r+   	test_charzTestStringScalarArr.test_charC  sf    K+2K+46 	) 	)CH9((((H9(((((	) 	)r-   c                     | j         j        j        | j         j        j        fD ] }d}|j        |k    sJ d}|j        |k    sJ !d S )N)r      z|S12)r    r   strarrstrarr77r   r   r   s      r+   test_char_arrz!TestStringScalarArr.test_char_arrK  sf    K+2K+46 	) 	)CH9((((H9(((((	) 	)r-   N)rV   rW   rX   r   getpathsourcesr   r   r9   r-   r+   r   r   @  sM        t|GUH6IJJKG) ) )) ) ) ) )r-   r   c                   <    e Zd Z ej        dddd          gZd ZdS )TestStringAssumedLengthr   r   r   z	gh24008.fc                 <    | j                             dd           d S )Njoebob)r    greet)r(   s    r+   test_gh24008z$TestStringAssumedLength.test_gh24008V  s     %'''''r-   N)rV   rW   rX   r   r   r   r  r9   r-   r+   r   r   S  s=        t|GUHkBBCG( ( ( ( (r-   r   c                   <    e Zd Z ej        dddd          gZd ZdS )TestStringOptionalInOutr   r   r   zgh24662.f90c                    | j                                          t          j        dd          }| j                             |           d|                                                                v sJ t          j        t                    5  d}| j                             |           d d d            d S # 1 swxY w Y   d S )NhiS32r   zoutput stringHi)	r    string_inout_optionalr"   r#   tobytesdecodera   raisesr   )r(   r   aas      r+   test_gh24662z$TestStringOptionalInOut.test_gh24662]  s    ))+++HT'''))!,,,!))++"4"4"6"66666]9%% 	2 	2BK--b111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s   B77B;>B;N)rV   rW   rX   r   r   r   r  r9   r-   r+   r  r  Y  s=        t|GUHmDDEG2 2 2 2 2r-   r  c                   d    e Zd Z ej        dddd           ej        dddd          gZdZd ZdS )	TestNewCharHandlingr   r   r   zgh25286.pyfgh25286.f90_char_handling_testc                 J    | j                             d          }|dk    sJ d S NTr   r    charintr(   infos     r+   test_gh25286z TestNewCharHandling.test_gh25286p  (    {""3''qyyyyyyr-   NrV   rW   rX   r   r   r   module_namer  r9   r-   r+   r  r  g  s]         	WeX}==WeX}==G (K    r-   r  c                   d    e Zd Z ej        dddd           ej        dddd          gZdZd ZdS )	TestBCCharHandlingr   r   r   zgh25286_bc.pyfr  r  c                 J    | j                             d          }|dk    sJ d S r  r  r  s     r+   r  zTestBCCharHandling.test_gh25286}  r  r-   Nr  r9   r-   r+   r   r   t  s^         	WeX/?@@WeX}==G (K    r-   r   )ra   r^   numpy.testingr   r   r   numpyr"   numpy.f2py.testsr   rb   r   F2PyTestr   re   r   r   r   r  r  r   r9   r-   r+   <module>r&     s      I I I I I I I I I I     ! ! ! ! ! ! {+ {+ {+ {+ {+$- {+ {+ {+|g$ g$ g$ g$ g$DM g$ g$ g$T	L2 L2 L2 L2 L2 L2 L2 L2^) ) ) ) )$- ) ) )&( ( ( ( (dm ( ( ( 
2 
2 
2 
2 
2dm 
2 
2 
2 
 
 
 
 
$- 
 
 
 
 
 
 
 
 
 
 
 
 
r-   