
    b                     Z    d Z ddlmZmZmZmZ ddlZ G d dej        j	                  Z
dS )zDTests for integer handling in PIDL generated bindings samba.dcerpc.*    )	server_idmiscsrvsvcsamrNc                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$S )%IntegerTestsc                     t          j                     }t           j        |_        |                     |j        d           d S Nl    )r   NONCLUSTER_VNN	unique_idassertEqualselfss     </usr/lib/python3/dist-packages/samba/tests/dcerpc/integer.pytest_uint32_into_hyperz#IntegerTests.test_uint32_into_hyper   s8    !!.j11111    c                 p    t          j                     }d|_        |                     |j        d           d S )N   )r   r   r   r   s     r   test_int_into_hyperz IntegerTests.test_int_into_hyper   s5    !!a(((((r   c                 n    t          j                     fd}|                     t          |           d S )Nc                      d _         d S N)r   r   s   r   assignz9IntegerTests.test_negative_int_into_hyper.<locals>.assign'   s    AKKKr   r   assertRaisesOverflowErrorr   r   r   s     @r   test_negative_int_into_hyperz)IntegerTests.test_negative_int_into_hyper$   sF    !!	 	 	 	 	-00000r   c                 n    t          j                     fd}|                     t          |           d S )Nc                  *    t           j         _        d S N)r    SERVERID_UNIQUE_ID_NOT_TO_VERIFYvnnr   s   r   r   z3IntegerTests.test_hyper_into_uint32.<locals>.assign.   s    >AEEEr   r   r    s     @r   test_hyper_into_uint32z#IntegerTests.test_hyper_into_uint32+   sF    !!	? 	? 	? 	? 	?-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   r%   timezoner   s   r   r   z2IntegerTests.test_hyper_into_int32.<locals>.assign5       "CAJJJr   r   NetRemoteTODInfor   r   r    s     @r   test_hyper_into_int32z"IntegerTests.test_hyper_into_int322   sK    #%%	D 	D 	D 	D 	D-00000r   c                 p    t          j                    }d|_        |                     |j        d           d S N   r   r-   r*   r   r   s     r   test_int_into_int32z IntegerTests.test_int_into_int329   s5    #%%
Q'''''r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   r   r*   r   s   r   r   z3IntegerTests.test_uint32_into_int32.<locals>.assignA   s    "1AJJJr   r,   r    s     @r   test_uint32_into_int32z#IntegerTests.test_uint32_into_int32>   sF    #%%	2 	2 	2 	2 	2-00000r   c                 p    t          j                    }d|_        |                     |j        d           d S r0   r2   r   s     r   test_long_into_int32z!IntegerTests.test_long_into_int32E   s7    #%% %
Q'''''r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d _         d S )Nl        r*   r   s   r   r   z<IntegerTests.test_larger_long_int_into_int32.<locals>.assignS   s    #AJJJr   r,   r    s     @r   test_larger_long_int_into_int32z,IntegerTests.test_larger_long_int_into_int32P   sF    #%%	$ 	$ 	$ 	$ 	$-00000r   c                 p    t          j                    }d|_        |                     |j        d           d S )Nir2   r   s     r   test_larger_int_into_int32z'IntegerTests.test_larger_int_into_int32W   s5    #%%
Z00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d _         d S )Ng      @r;   r   s   r   r   z2IntegerTests.test_float_into_int32.<locals>.assign_       AJJJr   r   r-   r   	TypeErrorr    s     @r   test_float_into_int32z"IntegerTests.test_float_into_int32\   F    #%%	 	 	 	 	)V,,,,,r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d _         d S )Ng       @r;   r   s   r   r   z6IntegerTests.test_int_float_into_int32.<locals>.assignf   rA   r   rB   r    s     @r   test_int_float_into_int32z&IntegerTests.test_int_float_into_int32c   rE   r   c                 p    t          j                    }d|_        |                     |j        d           d S )Ni   r2   r   s     r   test_negative_int_into_int32z)IntegerTests.test_negative_int_into_int32j   s5    #%% 
[11111r   c                 n    t          j                     fd}|                     t          |           d S )Nc                      d _         d S r   )r&   r   s   r   r   z6IntegerTests.test_negative_into_uint32.<locals>.assignr   s    AEEEr   r   r    s     @r   test_negative_into_uint32z&IntegerTests.test_negative_into_uint32o   sF    !!	 	 	 	 	-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   r%   time_midgs   r   r   z3IntegerTests.test_hyper_into_uint16.<locals>.assigny   r+   r   r   GUIDr   r   r   r   rR   s     @r   test_hyper_into_uint16z#IntegerTests.test_hyper_into_uint16v   sH    IKK	D 	D 	D 	D 	D-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d _         d S )Ni@ rP   rQ   s   r   r   z1IntegerTests.test_int_into_uint16.<locals>.assign   s    AJJJr   rS   rU   s     @r   test_int_into_uint16z!IntegerTests.test_int_into_uint16}   sC    IKK	  	  	  	  	 -00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d _         d S )NrY   rQ   s   r   r   z:IntegerTests.test_negative_int_into_uint16.<locals>.assign   s    AJJJr   rS   rU   s     @r   test_negative_int_into_uint16z*IntegerTests.test_negative_int_into_uint16   C    IKK	 	 	 	 	-00000r   c                     t          j                    }t           j        |_        |                     |j        t           j                   d S r$   )r   rT   SEC_CHAN_DOMAINrP   r   r   rR   s     r   test_enum_into_uint16z"IntegerTests.test_enum_into_uint16   s8    IKK)
T%9:::::r   c                     t          j                    }t           j        |_        |                     |j        t           j                   d S r$   )r   rT   SV_TYPE_WFWrP   r   rb   s     r   test_bitmap_into_uint16z$IntegerTests.test_bitmap_into_uint16   s8    IKK%
T%566666r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   SV_TYPE_LOCAL_LIST_ONLYrP   rQ   s   r   r   z=IntegerTests.test_overflow_bitmap_into_uint16.<locals>.assign   s    5AJJJr   rS   rU   s     @r    test_overflow_bitmap_into_uint16z-IntegerTests.test_overflow_bitmap_into_uint16   sC    IKK	6 	6 	6 	6 	6-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   SV_TYPE_DOMAIN_ENUMrP   rQ   s   r   r   z?IntegerTests.test_overflow_bitmap_into_uint16_2.<locals>.assign   s    1AJJJr   rS   rU   s     @r   "test_overflow_bitmap_into_uint16_2z/IntegerTests.test_overflow_bitmap_into_uint16_2   sC    IKK	2 	2 	2 	2 	2-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                  *    t           j         _        d S r$   )r   r%   max_password_ager   s   r   r   z2IntegerTests.test_hyper_into_int64.<locals>.assign   s    !*!KAr   )r   DomInfo1r   r   r    s     @r   test_hyper_into_int64z"IntegerTests.test_hyper_into_int64   sH    MOO	L 	L 	L 	L 	L-00000r   c                 p    t          j                    }d|_        |                     |j        d           d S r0   r   rr   rq   r   r   s     r   test_int_into_int64z IntegerTests.test_int_into_int64   s4    MOO+Q/////r   c                 p    t          j                    }d|_        |                     |j        d           d S )Nru   r   s     r   test_negative_int_into_int64z)IntegerTests.test_negative_int_into_int64   s4    MOO+R00000r   c                     t          j                    }t          j        |_        |                     |j        d           d S r
   )r   rr   r   r   rq   r   r   s     r   test_larger_int_into_int64z'IntegerTests.test_larger_int_into_int64   s7    MOO&5+Z88888r   c                 p    t          j                    }d|_        |                     |j        d           d S )Nl    ru   r   s     r   #test_larger_negative_int_into_int64z0IntegerTests.test_larger_negative_int_into_int64   s4    MOO(+[99999r   c                     t          j                    }g d|_        |                     |j        d         d           d S N)r1   r   r1   r         r   r1   r   rT   noder   rb   s     r   test_int_list_over_listz$IntegerTests.test_int_list_over_list   <    IKK###A&&&&&r   c                     t          j                    }g d|_        |                     |j        d         d           d S r   r   rb   s     r   "test_long_int_list_over_uint8_listz/IntegerTests.test_long_int_list_over_uint8_list   r   r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      g d _         d S )N)r   r   r1   r   r   r   r   rQ   s   r   r   z?IntegerTests.test_negative_list_over_uint8_list.<locals>.assign   s    (((AFFFr   rS   rU   s     @r   "test_negative_list_over_uint8_listz/IntegerTests.test_negative_list_over_uint8_list   sC    IKK	) 	) 	) 	) 	)-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      g d _         d S )N)   r   r1   r   r   r   r   rQ   s   r   r   z?IntegerTests.test_overflow_list_over_uint8_list.<locals>.assign   s    )))AFFFr   rS   rU   s     @r   "test_overflow_list_over_uint8_listz/IntegerTests.test_overflow_list_over_uint8_list   sC    IKK	* 	* 	* 	* 	*-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      g d _         d S )N)r1   r   r1   r   rQ   s   r   r   z<IntegerTests.test_short_list_over_uint8_list.<locals>.assign   s    YYAFFFr   r   rT   r   rC   rU   s     @r   test_short_list_over_uint8_listz,IntegerTests.test_short_list_over_uint8_list   sC    IKK	 	 	 	 	)V,,,,,r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      g d _         d S )N)r1   r   r1      r   r   r   r   r   rQ   s   r   r   z;IntegerTests.test_long_list_over_uint8_list.<locals>.assign   s    <<<AFFFr   r   rU   s     @r   test_long_list_over_uint8_listz+IntegerTests.test_long_list_over_uint8_list   sC    IKK	= 	= 	= 	= 	=)V,,,,,r   c                     t          j                    }d|j        d<   |                     |j        d         d           d S )Nr1   r   r   rb   s     r   test_assign_into_uint8_listz(IntegerTests.test_assign_into_uint8_list   s:    IKKq	A&&&&&r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d j         d<   d S )Nr   r   r   rQ   s   r   r   z:IntegerTests.test_negative_into_uint8_list.<locals>.assign   s    AF1IIIr   rS   rU   s     @r   test_negative_into_uint8_listz*IntegerTests.test_negative_into_uint8_list   sC    IKK	 	 	 	 	-00000r   c                 n    t          j                    fd}|                     t          |           d S )Nc                      d j         d<   d S )Nr   r   r   rQ   s   r   r   z:IntegerTests.test_overflow_into_uint8_list.<locals>.assign   s    AF1IIIr   rS   rU   s     @r   test_overflow_into_uint8_listz*IntegerTests.test_overflow_into_uint8_list   r_   r   N)&__name__
__module____qualname__r   r   r!   r'   r.   r3   r6   r8   r<   r>   rD   rH   rJ   rM   rV   rZ   r^   rc   rf   rj   rn   rs   rv   ry   r{   r}   r   r   r   r   r   r   r   r   r    r   r   r   r      s!       2 2 2
) ) )
1 1 11 1 11 1 1( ( (
1 1 1	( 	( 	(1 1 11 1 1
- - -- - -2 2 2
1 1 11 1 11 1 11 1 1; ; ;
7 7 7
1 1 11 1 11 1 10 0 0
1 1 1
9 9 9
: : :
' ' '
' ' '
1 1 11 1 1- - -- - -' ' '
1 1 11 1 1 1 1r   r   )__doc__samba.dcerpcr   r   r   r   samba.testssambatestsTestCaser   r   r   r   <module>r      s   $ K J 6 6 6 6 6 6 6 6 6 6 6 6    b1 b1 b1 b1 b15;' b1 b1 b1 b1 b1r   