ó
ŒwÛjc           @   sû  d  d l  Z  d  d l m Z d  d l m Z m Z 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 m Z d  d l Z y d  d l Z Wn e k
 r¹ e Z n Xe d ƒ Z e  j e e j ƒ  d ƒ d ƒ Z e  j e e j ƒ  d ƒ d ƒ Z d	 e  j f d
 „  ƒ  YZ d e  j f d „  ƒ  YZ d e  j f d „  ƒ  YZ d e f d „  ƒ  YZ  d e  e  j f d „  ƒ  YZ! d e  e  j f d „  ƒ  YZ" d e d „ Z# e e d „ Z$ d Z% d f  d „  ƒ  YZ& d „  Z' e( d k r÷e' ƒ  n  d S(   iÿÿÿÿN(   t   test_support(   t   TESTFNt   run_unittestt   import_modulet   unlinkt   requires(   t   precisionbigmemtestt   _1Gt   _4Gt   zlibt   copys   requires Compress.copy()s   requires Decompress.copy()t   ChecksumTestCasec           B   sY   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         C   sB   |  j  t j d ƒ t j d d ƒ ƒ |  j t j d d ƒ ƒ d  S(   Nt    i    t   abcIÿÿÿÿ    (   t   assertEqualR	   t   crc32t
   assertTrue(   t   self(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_crc32start   s    %c         C   sX   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ d  S(   NR   i    i   i°  (   R   R	   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_crc32empty   s    c         C   sB   |  j  t j d ƒ t j d d ƒ ƒ |  j t j d d ƒ ƒ d  S(   NR   i   R   Iÿÿÿÿ    (   R   R	   t   adler32R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_adler32start$   s    %c         C   sX   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ d  S(   NR   i    i   i°  (   R   R	   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_adler32empty(   s    c         C   s   |  j  | d @| d @ƒ d  S(   Nl   ÿÿ (   R   (   R   t   seent   expected(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   assertEqual32-   s    c         C   s¾   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j t j d ƒ t j d d ƒ ƒ |  j t j d ƒ t j d d ƒ ƒ d  S(   Nt   penguini    l    !ƒK i   i”ª¶CiöÏi÷Ö(   R   R	   R   R   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_penguins2   s    %c         C   sr   d } |  j  t j | ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j | | ƒ d ƒ |  j  t j d ƒ d ƒ d S(   s7   test issue1202 compliance: signed crc32, adler32 in 2.xt   abcdefghijklmnopi“À:”t   spami=ÿÚCi Õi²ON(   R   R	   R   R   (   R   t   foo(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_abcdefghijklmnop;   s
    c         C   sN   d } |  j  t j | ƒ t j | ƒ ƒ |  j  t j d ƒ t j d ƒ ƒ d  S(   NR   R   (   R   t   binasciiR   R	   (   R   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_same_as_binascii_crc32D   s    "c         C   s|   |  j  t j d d ƒ t j d d ƒ ƒ |  j  t j d d ƒ t j d d ƒ ƒ |  j  t j d d
 ƒ t j d d ƒ ƒ d  S(   Nt   hamiÿÿÿÿl   ÿÿ R   i'Ðÿl   '  i   i   I   €    i   €I   €    (   R   R	   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_negative_crc_iv_inputI   s
    ((   t   __name__t
   __module__R   R   R   R   R   R   R   R!   R#   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR      s   										t   ChecksumBigBufferTestCasec           B   s0   e  Z e d  e d d d d e ƒ d „  ƒ Z RS(   t   sizei   t   memusei   t   dry_runc         C   sL   d t  d } |  j t j | ƒ d @d ƒ |  j t j | ƒ d @d ƒ d  S(   Nt   nyani   Iÿÿÿÿ    iM"B>Iíáƒ†    (   R   R   R	   R   R   (   R   R'   t   data(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_big_bufferW   s    (   R$   R%   R   R   t   FalseR,   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR&   U   s   t   ExceptionTestCasec           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z e j d „  ƒ Z RS(   c         C   s    |  j  t j t j d d ƒ d  S(   Nt   ERRORi
   (   t   assertRaisesR	   t   errort   compress(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_badlevel`   s    c         C   sI   |  j  t t j d t j d ƒ |  j  t t j d t j t j d ƒ d  S(   Ni   i    (   R0   t
   ValueErrorR	   t   compressobjt   DEFLATEDt	   MAX_WBITS(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_badcompressobjf   s    	c         C   s   |  j  t t j d ƒ d  S(   Niÿÿÿÿ(   R0   R4   R	   t   decompressobj(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_baddecompressobjm   s    c         C   s<   |  j  t t j ƒ  j d ƒ |  j  t t j ƒ  j d ƒ d  S(   Ni    iÿÿÿÿ(   R0   R4   R	   R9   t   flush(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompressobj_badflushq   s    c      	   C   s    |  j  t d ƒ � t j d d t j d ƒ Wd  QX|  j  t d ƒ �" t j ƒ  j d t j d ƒ Wd  QX|  j  t d ƒ � t j ƒ  j t j d ƒ Wd  QXd  S(   Ns   int too largeR   i   i   (   t   assertRaisesRegexpt   OverflowErrorR	   t
   decompresst   syst   maxsizeR9   R;   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_overflowv   s     #(	   R$   R%   R3   R8   R:   R<   t   supportt   cpython_onlyRB   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR.   ^   s
   				t   BaseCompressTestCasec           B   s   e  Z d  „  Z d „  Z RS(   c         C   sŠ   d } d d | } d j  g  t d ƒ D]& } t j | t j d | ƒ ƒ ^ q' ƒ } | | t | ƒ d } z | | ƒ Wd  d  } Xd  S(	   Ni   s   %%0%dxi   R   i
   i   i   i   (   t   joint   rangeR    t   a2b_hext   randomt   getrandbitst   lent   None(   R   R'   t   compress_funct   _1Mt   fmtt   iR+   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   check_big_compress_buffer�   s    	9c         C   s}   d | } z t  j | d ƒ } Wd  d  } X| | ƒ } z9 |  j t | ƒ | ƒ |  j t | j d ƒ ƒ d ƒ Wd  d  } Xd  S(   Nt   xi   i    (   R	   R2   RL   R   RK   t   strip(   R   R'   t   decompress_funcR+   t
   compressed(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   check_big_decompress_buffer�   s    
#(   R$   R%   RQ   RV   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyRE   €   s   	t   CompressTestCasec           B   sË   e  Z d  „  Z d „  Z d „  Z e d e d d d ƒ d „  ƒ Z e d e d d d ƒ d	 „  ƒ Z e d e	 d d
 ƒ d „  ƒ Z
 d „  Z e j e j d k d ƒ e d e	 d d d ƒ d „  ƒ ƒ Z RS(   c         C   s,   t  j t ƒ } |  j t  j | ƒ t ƒ d  S(   N(   R	   R2   t   HAMLET_SCENER   R?   (   R   RR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_speech¢   s    c         C   s6   t  d } t j | ƒ } |  j t j | ƒ | ƒ d  S(   Ni€   (   RX   R	   R2   R   R?   (   R   R+   RR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_speech128¦   s    
c         C   s3   t  j t ƒ } |  j t  j d t  j | d  ƒ d  S(   NsA   Error -5 while decompressing data: incomplete or truncated streamiÿÿÿÿ(   R	   R2   RX   R=   R1   R?   (   R   RR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_incomplete_stream¬   s    R'   i   R(   i   c         C   s   d „  } |  j  | | ƒ d  S(   Nc         S   s   t  j |  d ƒ S(   Ni   (   R	   R2   (   t   s(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   <lambda>·   R   (   RQ   (   R   R'   R2   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_big_compress_bufferµ   s    	i   c         C   s   |  j  | t j ƒ d  S(   N(   RV   R	   R?   (   R   R'   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_big_decompress_bufferº   s    i   c         C   s?   t  d } t j | d ƒ } |  j t j | d | ƒ | ƒ d  S(   Ni
   i   i   (   RX   R	   R2   R   R?   (   R   R'   R+   RU   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_large_bufsize¾   s    
c         C   sB   t  d } t j | d ƒ } |  j t j | d t ƒ  ƒ | ƒ d  S(   Ni
   i   i   (   RX   R	   R2   R   R?   t	   CustomInt(   R   R+   RU   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_custom_bufsizeÅ   s    
i    s   requires 64bit platformid   i   c         C   sK   d | } z/ t  j | d ƒ } |  j t  j | ƒ | ƒ Wd  d  } } Xd  S(   NRR   i    (   R	   R2   R   R?   RL   (   R   R'   R+   t   comp(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_64bit_compressÊ   s
    
i   i   I       (   R$   R%   RY   RZ   R[   R   R   R^   R_   R   R`   Rb   t   unittestt
   skipUnlessR@   RA   Rd   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyRW       s   				""	t   CompressObjectTestCasec           B   sV  e  Z d  „  Z d „  Z d „  Z e d/ d d d „ Z d „  Z d/ d d d „ Z	 e d „ Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z e j e e d ƒ d ƒ d „  ƒ Z d „  Z d „  Z d „  Z e d e d d ƒ d „  ƒ Z d „  Z e d „  ƒ Z e d „  ƒ Z d „  Z  e! d „  ƒ Z" e! d „  ƒ Z# d „  Z$ d  „  Z% e d e& d0 d d" ƒ d# „  ƒ Z' e d e& d1 d d$ ƒ d% „  ƒ Z( e j e) j* d2 k d' ƒ e d e d( d d) ƒ d* „  ƒ ƒ Z+ e j e) j* d3 k d' ƒ e d e d( d d" ƒ d+ „  ƒ ƒ Z, e j e) j* d4 k d' ƒ e d e d( d d, ƒ d- „  ƒ ƒ Z- d. „  Z. RS(5   c         C   sŠ   t  d } t j ƒ  } | j | ƒ } | j ƒ  } |  j t j | j ƒ t j ƒ  } | j | | ƒ } | j ƒ  } |  j	 | | | ƒ d  S(   Ni€   (
   RX   R	   R5   R2   R;   R0   R1   R9   R?   R   (   R   R+   t   cot   x1t   x2t   dcot   y1t   y2(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt	   test_pair×   s    
c         C   s    d } t  j } d } d } t  j } t  j | | | | | ƒ } | j t ƒ } | j ƒ  } t  j | ƒ }	 |	 j | | ƒ }
 |	 j ƒ  } |  j	 t |
 | ƒ d  S(   Ni   iôÿÿÿi	   (
   R	   R6   t
   Z_FILTEREDR5   R2   RX   R;   R9   R?   R   (   R   t   levelt   methodt   wbitst   memlevelt   strategyRh   Ri   Rj   Rk   Rl   Rm   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_compressoptionsã   s    		c   	      C   sÊ   t  d } t j ƒ  } g  } xA t d t | ƒ d ƒ D]' } | j | j | | | d !ƒ ƒ q5 W| j | j ƒ  ƒ d j | ƒ } t j	 ƒ  } | j
 d j | ƒ ƒ } | j ƒ  } |  j | | | ƒ d  S(   Ni€   i    i   R   (   RX   R	   R5   RG   RK   t   appendR2   R;   RF   R9   R?   R   (	   R   R+   Rh   t   bufsRP   t   combufRk   Rl   Rm   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_compressincrementalò   s    
%i   i@   c         C   s¯  | p	 t  } | d } t j ƒ  } g  } xA t d t | ƒ | ƒ D]' } | j | j | | | | !ƒ ƒ qA W| j | j ƒ  ƒ d j | ƒ }	 |  j	 | t j
 |	 ƒ ƒ t j ƒ  }
 g  } xd t d t |	 ƒ | ƒ D]J } | j |
 j
 |	 | | | !ƒ ƒ |  j	 d |
 j d t |
 j ƒ ƒ qÒ W| r<| j |
 j ƒ  ƒ n3 x0 t rn|
 j
 d ƒ } | rj| j | ƒ q?Pq?W|  j	 d |
 j d t |
 j ƒ ƒ |  j	 | d j | ƒ ƒ d  S(   Ni€   i    R   s!   (A) uct should be '': not %d longs!   (B) uct should be '': not %d long(   RX   R	   R5   RG   RK   Rv   R2   R;   RF   R   R?   R9   t   unconsumed_tailt   True(   R   R;   t   sourcet   cxt   dcxR+   Rh   Rw   RP   Rx   Rk   t   chunk(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompinc  s6    
%!	c         C   s   |  j  d t ƒ d  S(   NR;   (   R€   R{   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompincflush$  s    c         C   sV  | p	 t  } | d } t j ƒ  } g  } xA t d t | ƒ | ƒ D]' } | j | j | | | | !ƒ ƒ qA W| j | j ƒ  ƒ d j | ƒ } |  j	 | t j
 | ƒ d ƒ t j ƒ  }	 g  } | }
 x^ |
 r"|	 j
 |
 | ƒ } |  j t | ƒ | k d t | ƒ | f ƒ | j | ƒ |	 j }
 qÅ W| j |	 j ƒ  ƒ |  j	 | d j | ƒ d ƒ d  S(   Ni€   i    R   s   compressed data failures   chunk too big (%d>%d)s   Wrong data retrieved(   RX   R	   R5   RG   RK   Rv   R2   R;   RF   R   R?   R9   t   assertFalseRz   (   R   R|   R}   R~   R+   Rh   Rw   RP   Rx   Rk   t   cbR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompimax'  s*    
%	c         C   s¿  t  d } t j ƒ  } g  } xA t d t | ƒ d ƒ D]' } | j | j | | | d !ƒ ƒ q5 W| j | j ƒ  ƒ d j | ƒ } |  j	 | t j
 | ƒ d ƒ t j ƒ  } g  } | } xr | r*d t | ƒ d }	 | j
 | |	 ƒ }
 |  j t |
 ƒ |	 k d t |
 ƒ |	 f ƒ | j |
 ƒ | j } q¹ W| rG| j | j ƒ  ƒ nX xU |
 rž| j
 d |	 ƒ }
 |  j t |
 ƒ |	 k d t |
 ƒ |	 f ƒ | j |
 ƒ qJW|  j	 | d j | ƒ d	 ƒ d  S(
   Ni€   i    i   R   s   compressed data failurei   i
   s   chunk too big (%d>%d)s   Wrong data retrieved(   RX   R	   R5   RG   RK   Rv   R2   R;   RF   R   R?   R9   R‚   Rz   (   R   R;   R+   Rh   Rw   RP   Rx   Rk   Rƒ   t
   max_lengthR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompressmaxlenB  s6    
%		c         C   s   |  j  d t ƒ d  S(   NR;   (   R†   R{   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompressmaxlenflushb  s    c         C   s<   t  j ƒ  } |  j t | j d d ƒ |  j d | j ƒ d  S(   NR   iÿÿÿÿ(   R	   R9   R0   R4   R?   R   Rz   (   R   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_maxlenmisce  s    c         C   sg   t  d } d } |  j t | ƒ | ƒ t j | d ƒ } t j ƒ  } |  j | j | t j	 ƒ | ƒ d  S(   Ni
   i   i   i   i @  (
   RX   t   assertGreaterRK   R	   R2   R9   R   R?   R@   RA   (   R   R+   t   DEFAULTALLOCRU   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_maxlen_largek  s    
c         C   sO   t  d } t j | d ƒ } t j ƒ  } |  j | j | t ƒ  ƒ | d  ƒ d  S(   Ni
   i   id   (   RX   R	   R2   R9   R   R?   Ra   (   R   R+   RU   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_maxlen_customu  s    
c         C   sQ   d } t  j ƒ  } | j | d ƒ } | | j | j ƒ 7} |  j | j d ƒ d  S(   Ns
   xœKLJ Mi   R   (   R	   R9   R?   Rz   R   (   R   t   cdataRk   t   ddata(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_clear_unconsumed_tail{  s
    c      	   C   s  d d d g } g  | D]$ } t  t | ƒ r t t | ƒ ^ q } t d } x³ | D]« } x¢ t d ƒ D]” } t j | ƒ } | j | d  ƒ } | j | ƒ } | j | d ƒ }	 | j ƒ  }
 |  j t j	 d j
 | | |	 |
 g ƒ ƒ | d | | f ƒ ~ qd WqQ Wd  S(	   Nt
   Z_NO_FLUSHt   Z_SYNC_FLUSHt   Z_FULL_FLUSHi   i
   i¸  R   s*   Decompress failed: flush mode=%i, level=%i(   t   hasattrR	   t   getattrRX   RG   R5   R2   R;   R   R?   RF   (   R   t   sync_optt   optR+   t   syncRp   t   objt   at   bt   ct   d(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_flushes„  s    $
'R‘   s   requires zlib.Z_SYNC_FLUSHc   	      C   så   d d  l  } t j t j ƒ } t j ƒ  } y | j ƒ  } Wn; t k
 rw y | j ƒ  } Wqx t k
 rs | } qx Xn X| j d ƒ t	 d d d | ƒ} | j
 | ƒ } | j t j ƒ } | j | | ƒ } |  j | | d ƒ d  S(   Niÿÿÿÿi   i   i   t	   generators   17K random source doesn't matchi D  (   RI   R	   R5   t   Z_BEST_COMPRESSIONR9   t   WichmannHillt   AttributeErrort   Randomt   seedt   genblockR2   R;   R‘   R?   R   (	   R   RI   Rh   Rk   t   genR+   t   firstt   secondt   expanded(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_odd_flush˜  s     c         C   sK   t  j t  j ƒ } |  j | j ƒ  ƒ t  j ƒ  } |  j | j ƒ  d ƒ d  S(   NR   (   R	   R5   RŸ   R   R;   R9   R   (   R   Rh   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_empty_flushº  s    c         C   s   d } |  j  t j | ƒ d ƒ |  j t j t j | d  ƒ t j ƒ  } | j | d  ƒ } | | j ƒ  7} |  j  | d ƒ d  S(   Ns   xœKËÏ ‚ER   iûÿÿÿ(   R   R	   R?   R0   R1   R9   R;   (   R   RR   Rk   t   y(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt!   test_decompress_incomplete_streamÄ  s    c         C   sg   d } d } t  j | ƒ } t  j ƒ  } | j | d ƒ ~ t  j | ƒ } |  j | j ƒ  | d ƒ d  S(   Nt   abcdefghijklmnopqrstuvwxyzt   QWERTYUIOPASDFGHJKLZXCVBNMi   (   R	   R2   R9   R?   R   R;   (   R   t   input1t   input2R+   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_flush_with_freed_inputÑ  s    R'   R(   i   c         C   sY   t  d } t j | d ƒ } t j ƒ  } | j | d ƒ |  j | j | ƒ | d ƒ d  S(   Ni
   i   (   RX   R	   R2   R9   R?   R   R;   (   R   R'   t   inputR+   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_flush_large_lengthÝ  s
    
c         C   s\   t  d } t j | d ƒ } t j ƒ  } | j | d ƒ |  j | j t ƒ  ƒ | d ƒ d  S(   Ni
   i   (   RX   R	   R2   R9   R?   R   R;   Ra   (   R   R²   R+   Rk   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_flush_custom_lengthæ  s
    
c   	      C   s  t  } t  j ƒ  } t j t j ƒ } g  } | j | j | ƒ ƒ | j ƒ  } | } | j | j | ƒ ƒ | j | j ƒ  ƒ d j	 | ƒ } | j | j | ƒ ƒ | j | j ƒ  ƒ d j	 | ƒ } |  j
 t j | ƒ | | ƒ |  j
 t j | ƒ | | ƒ d  S(   NR   (   RX   t   swapcaseR	   R5   RŸ   Rv   R2   R
   R;   RF   R   R?   (	   R   t   data0t   data1t   c0t   bufs0t   c1t   bufs1t   s0t   s1(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_compresscopyí  s    c         C   s:   t  j ƒ  } | j t ƒ | j ƒ  |  j t | j ƒ d  S(   N(   R	   R5   R2   RX   R;   R0   R4   R
   (   R   R›   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_badcompresscopy  s    
c   
   
   C   sn  d } d } t  j | ƒ } | | } xBd D]:} x1d d t | ƒ t | ƒ f D]} t  j ƒ  } d } x° t d t | ƒ | ƒ D]– }	 |	 t | ƒ k  r° |  j | j d ƒ n  | d k rð | | j | |	 |	 | !ƒ 7} |  j | j d ƒ q‚ | | j | j | |	 |	 | !| ƒ 7} q‚ W| | j	 ƒ  7} |  j | | ƒ |  j | j d ƒ |  j | j | ƒ qQ Wq, Wd  S(	   NR­   t
   0123456789i    iè  i   i   R   (   i    iè  (
   R	   R2   RK   R9   RG   R   t   unused_dataR?   Rz   R;   (
   R   R|   t	   remainderR«   RR   t   maxlent   stepRk   R+   RP   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompress_unused_data  s(    
%	#c   	      C   sÊ   t  } t j | ƒ } t j ƒ  } g  } | j | j | d  ƒ ƒ | j ƒ  } | } | j | j | d ƒ ƒ d j | ƒ } | j | j | d ƒ ƒ d j | ƒ } |  j | | ƒ |  j | | ƒ d  S(   Ni    R   (	   RX   R	   R2   R9   Rv   R?   R
   RF   R   (	   R   R+   Rc   t   d0R¹   t   d1R»   R¼   R½   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompresscopy%  s    c         C   sI   t  j t ƒ } t  j ƒ  } | j | ƒ | j ƒ  |  j t | j ƒ d  S(   N(	   R	   R2   RX   R9   R?   R;   R0   R4   R
   (   R   R+   Rœ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_baddecompresscopy;  s
    
c         C   s]   xV t  t j d ƒ D]A } |  j t t j f ƒ �! t j t j t j	 ƒ | ƒ Wd  QXq Wd  S(   Ni   (
   RG   t   picklet   HIGHEST_PROTOCOLR0   t	   TypeErrort   PicklingErrort   dumpsR	   R5   RŸ   (   R   t   proto(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_compresspickleD  s    c         C   sW   xP t  t j d ƒ D]; } |  j t t j f ƒ � t j t j ƒ  | ƒ Wd  QXq Wd  S(   Ni   (	   RG   RÊ   RË   R0   RÌ   RÍ   RÎ   R	   R9   (   R   RÏ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_decompresspickleI  s    i   i   c            s2   t  j d ƒ ‰  ‡  f d †  } |  j | | ƒ d  S(   Ni   c            s   ˆ  j  |  ƒ ˆ  j ƒ  S(   N(   R2   R;   (   R\   (   R›   (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR]   S  R   (   R	   R5   RQ   (   R   R'   R2   (    (   R›   s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR^   P  s    i   c            s/   t  j ƒ  ‰  ‡  f d †  } |  j | | ƒ d  S(   Nc            s   ˆ  j  |  ƒ ˆ  j ƒ  S(   N(   R?   R;   (   R\   (   Rœ   (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR]   Y  R   (   R	   R9   RV   (   R   R'   R?   (    (   Rœ   s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR_   V  s    i    s   requires 64bit platformid   i   c         C   s�   d | } t  j d ƒ } t  j ƒ  } zF | j | ƒ | j ƒ  } | j | ƒ | j ƒ  } |  j | | ƒ Wd  d  } } } Xd  S(   NRR   i    (   R	   R5   R9   R2   R;   R?   R   RL   (   R   R'   R+   Rh   t   doRc   t   uncomp(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyRd   \  s    
c         C   s…   d } d | } t  j | ƒ | } t  j ƒ  } z@ | j | ƒ | j ƒ  } |  j | | j ƒ |  j | | ƒ Wd  d  } } } Xd  S(   NR   RR   (   R	   R2   R9   R?   R;   R   RÁ   RL   (   R   R'   R+   t   unusedRc   RÒ   RÓ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_large_unused_datai  s    
i   c         C   s�   d | } t  j ƒ  } zU t  j | d ƒ } | j | d ƒ | j ƒ  } |  j | | ƒ |  j | j d ƒ Wd  d  } } } Xd  S(   NRR   i    i   R   (   R	   R9   R2   R?   R;   R   Rz   RL   (   R   R'   R+   RÒ   Rc   RÓ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   test_large_unconsumed_tailw  s    
c         C   s=  t  j d t  j d ƒ } | j t ƒ | j ƒ  } |  j t  j | d ƒ t ƒ |  j t  j | d
 ƒ t ƒ |  j t  j	 d ƒ � t  j | d ƒ Wd  QXt  j
 d ƒ } |  j | j | ƒ t ƒ t  j
 d ƒ } |  j t  j	 d ƒ � | j | ƒ Wd  QXt  j d t  j d ƒ } | j t ƒ | j ƒ  } |  j t  j | d ƒ t ƒ |  j t  j | d ƒ t ƒ |  j t  j | d ƒ t ƒ t  j
 d ƒ } |  j | j | ƒ t ƒ t  j d t  j d ƒ } | j t ƒ | j ƒ  } |  j t  j | d ƒ t ƒ t  j
 d ƒ } |  j | j | ƒ t ƒ t  j d t  j d ƒ } | j t ƒ | j ƒ  } |  j t  j | d ƒ t ƒ |  j t  j | d ƒ t ƒ t  j
 d ƒ } |  j | j | ƒ t ƒ t  j d t  j d ƒ } | j t ƒ | j ƒ  } |  j t  j | d ƒ t ƒ |  j t  j | d ƒ t ƒ t  j
 d ƒ } |  j | j | ƒ t ƒ d  S(   Ni   i   i    s   invalid window sizei   i	   iñÿÿÿi÷ÿÿÿi   i/   i/   i)   i)   i   i   i/   i/   (   R	   R5   R6   R2   RX   R;   R   R?   R=   R1   R9   (   R   Rh   t   zlib15Rk   t   zlib9t	   deflate15t   deflate9t   gzip(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt
   test_wbits„  sF    Ni   i   I       I       I       (/   R$   R%   Rn   Ru   Ry   R-   RL   R€   R�   R„   R†   R‡   Rˆ   R‹   RŒ   R�   R�   Re   Rf   R“   R	   R©   Rª   R¬   R±   R   R   R³   R´   t   requires_Compress_copyR¾   R¿   RÅ   t   requires_Decompress_copyRÈ   RÉ   RÐ   RÑ   R   R^   R_   R@   RA   Rd   RÕ   RÖ   RÜ   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyRg   Õ   sH   			#	 			
				!	
								""%%%i   c      	   C   s¸   |  d k	 r | j |  ƒ n  | j } | | k  s= | d k  rF | } n  g  } xX t d | | ƒ D]D } | j d j g  t | ƒ D] } t | d d ƒ ƒ ^ q~ ƒ ƒ q_ Wd j | ƒ |  S(   sD   length-byte stream of random data from a seed (in step-byte blocks).i   i    R   iÿ   N(   RL   R£   t   randintRG   Rv   RF   t   chr(   R£   t   lengthRÄ   Rž   Rß   t   blocksRP   RR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyR¤   ®  s    		3c         C   sQ   | d k	 r | j | ƒ n  |  j d ƒ } g  t | ƒ D] } | j | ƒ ^ q8 S(   s=   Return a list of number lines randomly chosen from the sources   
N(   RL   R£   t   splitRG   t   choice(   R|   t   numberR£   Rž   t   sourcest   n(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   choose_lines½  s    s�  
LAERTES

       O, fear me not.
       I stay too long: but here my father comes.

       Enter POLONIUS

       A double blessing is a double grace,
       Occasion smiles upon a second leave.

LORD POLONIUS

       Yet here, Laertes! aboard, aboard, for shame!
       The wind sits in the shoulder of your sail,
       And you are stay'd for. There; my blessing with thee!
       And these few precepts in thy memory
       See thou character. Give thy thoughts no tongue,
       Nor any unproportioned thought his act.
       Be thou familiar, but by no means vulgar.
       Those friends thou hast, and their adoption tried,
       Grapple them to thy soul with hoops of steel;
       But do not dull thy palm with entertainment
       Of each new-hatch'd, unfledged comrade. Beware
       Of entrance to a quarrel, but being in,
       Bear't that the opposed may beware of thee.
       Give every man thy ear, but few thy voice;
       Take each man's censure, but reserve thy judgment.
       Costly thy habit as thy purse can buy,
       But not express'd in fancy; rich, not gaudy;
       For the apparel oft proclaims the man,
       And they in France of the best rank and station
       Are of a most select and generous chief in that.
       Neither a borrower nor a lender be;
       For loan oft loses both itself and friend,
       And borrowing dulls the edge of husbandry.
       This above all: to thine ownself be true,
       And it must follow, as the night the day,
       Thou canst not then be false to any man.
       Farewell: my blessing season this in thee!

LAERTES

       Most humbly do I take my leave, my lord.

LORD POLONIUS

       The time invites you; go; your servants tend.

LAERTES

       Farewell, Ophelia; and remember well
       What I have said to you.

OPHELIA

       'Tis in my memory lock'd,
       And you yourself shall keep the key of it.

LAERTES

       Farewell.
Ra   c           B   s   e  Z d  „  Z RS(   c         C   s   d S(   Nid   (    (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   __int__  s    (   R$   R%   Ré   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyRa     s   c           C   s   t  t t t t t ƒ d  S(   N(   R   R   R&   R.   RW   Rg   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt	   test_main  s    t   __main__()   Re   t   testR    RC   t   test.test_supportR   R   R   R   R   R    RÊ   RI   R   R   R   R@   t   mmapt   ImportErrorRL   R	   Rf   R“   R5   RÝ   R9   RÞ   t   TestCaseR   R&   R.   t   objectRE   RW   Rg   R¤   Rè   RX   Ra   Rê   R$   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_zlib.pyt   <module>   s@   (
		<	" 5ÿ ÚG		