ó
ŒwÛjc        
   @   sO  d  d l  Z  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	 m
 Z
 d  d l Z e j d k Z e j d k Z d d d d	 d
 d d d d d f
 Z e  j j e ƒ d d Z y e j d d ƒ Wn e j k
 rú e Z n Xe Z d „  Z d „  Z d e j f d „  ƒ  YZ d „  Z e d k rKe ƒ  n  d S(   iÿÿÿÿN(   t   test_support(   t   check_warningst   check_py3k_warningst   bigiÿÿÿt   bt   Bt   ht   Ht   it   It   lt   Lt   qt   Qi    s   .pyi   c         C   s   d j  t |  ƒ ƒ S(   Nt    (   t   joint   reversed(   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_struct.pyt   string_reverse   s    c         C   s   t  r
 |  St |  ƒ Sd  S(   N(   t   ISBIGENDIANR   (   t   value(    (    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_struct.pyt   bigendian_to_native   s    t
   StructTestc           B   sû   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z e d
 „ Z e e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e j e d ƒ d „  ƒ Z d „  Z d „  Z e j d „  ƒ Z d „  Z RS(   c         C   s«   t  d t f ƒ � } t j | | ƒ } Wd  QXt j ƒ  j d } |  j | j t	 ƒ |  j | j
 | ƒ |  j t | j ƒ d ƒ t j | t | ƒ ƒ } |  j | | ƒ d  S(   Ns&   .*integer argument expected, got floati   (   R   t   DeprecationWarningt   structt   packt   inspectt   currentframet   f_linenot   assertEqualt   filenamet   testmod_filenamet   linenot   lent   warningst   int(   t   selft   formatt   numbert   wt   gotR    t   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_struct.pyt   check_float_coerce$   s    c         C   s0   |  j  t j d d ƒ d t d ƒ k t ƒ d  S(   Ns   =ii   i    (   R   R   R   t   chrR   (   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_struct.pyt   test_isbigendian1   s    c         C   sr  |  j  t j t j d ƒ t j d ƒ } |  j | d t j d ƒ ƒ d } d } t j | ƒ } t j | ƒ } |  j | d | ƒ |  j  t j t j d d ƒ |  j  t j t j d d d d ƒ |  j  t t j f t j d d ƒ |  j  t t j f t j d d ƒ |  j  t j t j d	 d
 ƒ t j d d d ƒ } |  j  t j t j d | ƒ |  j  t j t j d | ƒ d  S(   Nt   ZR   i   t   iiis   cbxxxxxxhhhhiillffd?s   3c3b18x12h6i6l6f3d3?t   foot   Pt   dt   flapt   iii   i   (   t   assertRaisesR   t   errort   calcsizeR   R   t	   TypeErrort   unpack(   R$   t   szt   fmtt   fmt3t   sz3R   (    (    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_struct.pyt   test_consistence4   s     """c         C   sY  d } d } d } d } d } d } d } t  } x"d D]}	 xd D]	}
 |	 |
 }
 t j |
 | | | | | | | | ƒ	 } t j |
 | ƒ \ } } } } } } } } |  j | | ƒ |  j | | ƒ |  j | | ƒ |  j | | ƒ |  j | | ƒ |  j t d | ƒ t d | ƒ ƒ |  j t d | ƒ t d | ƒ ƒ |  j | | ƒ qD Wq7 Wd  S(   Nt   ai   iÿ   iÿÿ  i   goƒÀÊ!	@R   t   @t   <t   >t   =t   !s	   xcbhilfd?s	   xcBHILfd?id   (   R   R?   R@   RA   RB   RC   (   s	   xcbhilfd?s	   xcBHILfd?(   t   TrueR   R   R8   R   R#   (   R$   t   cR   R   R   R
   t   fR1   t   tt   prefixR%   R   t   cpt   bpt   hpt   ipt   lpt   fpt   dpt   tp(    (    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_struct.pyt   test_transitivenessI   s*    
'*$$c      '   C   sÎ  dE dF dG dH dI dJ dK dL dM d d
 d
 dN d
 dO d f dP dQ dR dS dT dU dV d$ dW d" d# d f dX dY dZ d- d[ d+ d, d f d\ d] d^ d1 d_ d+ d, d f d` da db dc dd de d> t  d@ d@ d f d> g  d d d f d> df d@ d@ d f g# } xç | D]ß \ } } } } } xÇ dA | | f dB | | f dC | | f dD | t r9| p<| f g D] \ } } t j | | ƒ }	 |  j |	 | ƒ |  j t j | ƒ t |	 ƒ ƒ t j | |	 ƒ d }
 |
 | k rC|  j | ƒ qCqCWqç Wd  S(g   NRE   R>   i    t   xcs    at   cxs   a R   t   0st
   helloworldR   i   t   1sR   t   9st	   helloworlt   10st   11ss   helloworld t   20si
   s    R   i   s   iùÿÿÿs   ùR   iù   i¼  s   ¼s   ¼iDýÿÿs   ýDs   DýR   i   R   i€,s   ,€s   €,i€âÓûs   ûÓâ€s   €âÓûR	   l   €Xl        R
   R   RF   g       @s   @   s      @R1   s   @       s          @g       Às   À   s      Às   À       s          Àt   ?i   s   RA   RC   R@   RB   (   RE   R>   R>   R>   i    (   RR   R>   s    as    ai    (   RS   R>   s   a s   a i    (   R   R>   R>   R>   i    (   RT   RU   R   R   i   (   RV   RU   R   R   i   (   RW   RU   RX   RX   i   (   RY   RU   RU   RU   i    (   RZ   RU   s   helloworld s   helloworld i   s
             s
             (   R   i   s   s   i    (   R   iùÿÿÿs   ùs   ùi    (   R   i   s   s   i    (   R   iù   s   ùs   ùi    (   R   i¼  s   ¼s   ¼i    (   R   iDýÿÿs   ýDs   Dýi    (   R   i¼  s   ¼s   ¼i    iDý  (   R   i€,s   ,€s   €,i    (   R   i€âÓûs   ûÓâ€s   €âÓûi    (   R	   l   €Xs   ,€s   €,i    l   €b§w (   R
   i€,s   ,€s   €,i    (   R
   i€âÓûs   ûÓâ€s   €âÓûi    (   R   l   €Xs   ,€s   €,i    l   €b§w (   RF   g       @s   @   s      @i    (   R1   g       @s   @       s          @i    (   RF   g       Às   À   s      Ài    (   R1   g       Às   À       s          Ài    (   R\   i    s    s    i    (   R\   i   s   s   i   (   i   (	   RD   R   R   R   R   R6   R!   R8   t
   assertTrue(   R$   t   testsR:   t   argR   t   lilt   asyt   xfmtt   expt   rest   rev(    (    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_struct.pyt   test_new_featuresa   s\      *)c   	      C   sú  i
 d d 6d d 6d d 6d d 6d d 6d d	 6d d
 6d d 6d d 6d d 6} xL t  D]D } x; d D]3 } | | } t j | ƒ } |  j | | | ƒ q` WqS Wxc d D][ } xR d d g D]D } t j | | d ƒ } t j | | d ƒ } |  j | | ƒ qµ Wq¢ W|  j t j d ƒ d ƒ |  j d t j d ƒ ƒ |  j d t j d
 ƒ ƒ |  j t j d ƒ t j d ƒ ƒ |  j t j d ƒ t j d
 ƒ ƒ t rö|  j t j d ƒ t j d ƒ ƒ |  j d t j d ƒ ƒ |  j t j d
 ƒ t j d ƒ ƒ n  d  S(   Ni   R   R   i   R   R   i   R   R	   R
   R   i   R   R   RB   R@   RA   RC   t   bBt   hHt   iIt   lLR   R?   i    (   RB   R@   RA   RC   (   Rg   Rh   Ri   Rj   (   t   integer_codesR   R6   R   t   assertLessEqualt   HAVE_LONG_LONG(	   R$   t   expected_sizet   codet	   byteorderR%   t   sizet   format_pairt   signed_sizet   unsigned_size(    (    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_struct.pyt   test_calcsize–   s2    
"""c            s¢   d d  l  ‰ d t j f ‡  ‡ ‡ f d †  ƒ  Y‰  d } xd t D]\ } xS | D]K } | d k rv | d k rv t rv qK n  | | ‰ ˆ  ˆ ƒ } | j ƒ  qK Wq> Wd  S(   Niÿÿÿÿt	   IntTesterc              sA   e  Z ‡  f d  †  Z e j e j ˆ j d „ Z ‡ f d †  Z RS(   c            s&  t  ˆ  |  ƒ j d d ƒ | |  _ | d |  _ | d  |  _ |  j d k ra t d
 |  j ƒ ‚ n  t j | ƒ |  _ |  j d |  _	 |  j t
 d ƒ k rÑ t |  _ d |  j	 d |  _ d |  j	 d d |  _ nQ |  j t
 d ƒ k rt |  _ d |  _ d |  j	 d |  _ n t d |  j ƒ ‚ d  S(   Nt
   methodNamet   test_oneiÿÿÿÿR   R?   RB   R@   RA   RC   s"   unrecognized packing direction: %si   t   bhilql    i   t   BHILQi    s   unrecognized format code: %s(   R   R?   RB   R@   RA   RC   (   t   supert   __init__R%   Ro   t	   directiont
   ValueErrorR   R6   t   bytesizet   bitsizet   tupleRD   t   signedt	   min_valuet	   max_valuet   False(   R$   R%   (   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_struct.pyR|   ¿   s&    				c   	      S   s™  |  j  } |  j | k o& |  j k n rst | ƒ } |  j r` | d k  r` | d |  j >7} n  |  j | d ƒ d | } t | ƒ d @r— d | } n  | | ƒ } d |  j t | ƒ | } |  j	 d k sã |  j	 d k rò t
 rò t | ƒ } n  |  j t | ƒ |  j ƒ | | | ƒ } |  j | | ƒ | | | ƒ d } |  j | | ƒ |  j t j t f | | d | ƒ n" |  j t t t j f | | | ƒ d  S(   Ni    l    s   %xi   t   0s    R@   R   R?   RB   s   (   R   R?   RB   (   R%   Rƒ   R„   t   longR‚   R€   t   assertGreaterEqualR!   R   R}   R   R   R   R4   R   R5   R7   t   OverflowErrorR~   (	   R$   t   xR   R8   t	   unhexlifyR%   R)   R(   t	   retrieved(    (    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_struct.pyRx   Õ   s0    	"
c            sÊ  d d l  m } g  } x, t |  j d ƒ D] } | j d | >ƒ q* WxX t |  j ƒ D]G } d } x+ t |  j ƒ D] } | d >| d ƒ B} qq W| j | ƒ qU W| j d d	 t j d
 g ƒ xg | D]_ } xV | | f D]G } x> d" D]6 } | | }	 |  j	 t
 |	 ƒ ƒ |  j	 t |	 ƒ ƒ qå WqØ WqÄ Wd t f d „  ƒ  Y}
 d d# d „  ƒ  Y} d t f d „  ƒ  Y} d t f d „  ƒ  Y} |  j t t j f t j |  j d ƒ |  j t t j f t j |  j | ƒ t d t f ƒ �7 |  j t t j f ƒ � t j |  j d$ ƒ Wd  QXWd  QXxÍ |
 ƒ  | ƒ  | ƒ  f D]³ } t d t f ƒ � } t j |  j | ƒ } Wd  QXt j ƒ  j d } |  j | j t ƒ |  j | j | ƒ |  j t | j ƒ d ƒ t j |  j t
 | ƒ ƒ } |  j | | ƒ q*Wxo | d ƒ | d ƒ | d ƒ | d ƒ | d ƒ | d ƒ f D]1 } y t j ˆ  | ƒ Wq|  j d ƒ qXqWxp | d ƒ | d  ƒ | d  ƒ | i d d 6ƒ | d d! d g ƒ f D]+ } |  j t t j f t j |  j | ƒ q—Wd  S(%   Niÿÿÿÿ(   t	   randrangei   l    l    i   i   i,  i`®
 i   i    i   t
   NotAnIntNSc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   d S(   Ni*   (    (   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_struct.pyt   __int__  s    c         S   s   d S(   Nl   Á(    (   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_struct.pyt   __long__  s    (   t   __name__t
   __module__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_struct.pyRŽ     s   	t
   NotAnIntOSc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   d S(   NiU   (    (   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_struct.pyR�      s    c         S   s   d S(   Nlÿÿÿÿ£ (    (   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_struct.pyR�   #  s    (   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_struct.pyR“     s   	t	   Indexablec           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   | |  _  d  S(   N(   t   _value(   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_struct.pyR|   *  s    c         S   s   |  j  S(   N(   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_struct.pyt	   __index__-  s    (   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_struct.pyR”   )  s   	t   BadIndexc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s
   t  ‚ d  S(   N(   R7   (   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_struct.pyR–   3  s    c         S   s   d S(   Ni*   (    (   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_struct.pyR�   6  s    (   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_struct.pyR—   2  s   	s   a strings*   integer argument expected, got non-integery              E@s,   .*integer argument expected, got non-integeri
   i   i*   id   i   s:   integer code pack failed on object with '__index__' methodR>   u   bi   (   iÿÿÿÿi    i   (    y      @      E@(    t   randomR�   t   rangeR€   t   appendR   t   extendt   syst   maxintRx   R#   R‡   t   objectR4   R7   R   R5   R   R%   R   R   R   R   R   R   R   R   R    R!   R"   t   failt   None(   R$   R�   t   valuesRc   R   t   valt   jt   baset   incrRŠ   RŽ   R“   R”   R—   t   nonintR'   R(   R    R)   t   obj(   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_struct.pyt   runú   sf    

	%,(	   R‘   R’   R|   R   R   R8   R‹   Rx   R¨   (    (   Rv   t   binasciiR%   (    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_struct.pyRv   ¾   s
   #R   R?   RB   R@   RA   RC   R   R   (   R   R?   RB   R@   RA   RC   (   R   R?   (   R   R   (   R©   t   unittestt   TestCaseRk   Rm   R¨   (   R$   t
   byteordersRo   Rp   RG   (    (   Rv   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_struct.pyt   test_integersº   s    %¤
c         C   sœ   x• d d d d d d d d d d d d d d d f g D]Y \ } } } } t  j | | ƒ } |  j | | ƒ t  j | | ƒ \ } |  j | | ƒ q; Wd  S(   Nt   pt   abcs    R   t   1pt   2ps   aR>   t   3ps   abt   abt   4ps   abct   5ps   abc t   6ps   abc  t   1000pRŠ   iè  s   ÿiç  iÿ   (   R®   R¯   s    R   (   R°   R¯   s    R   (   R±   R¯   s   aR>   (   R²   R¯   s   abR³   (   R´   R¯   s   abcR¯   (   Rµ   R¯   s   abc R¯   (   R¶   R¯   s   abc  R¯   (   R   R   R   R8   (   R$   Ro   t   inputR)   t   expectedbackR(   (    (    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_struct.pyt   test_p_codel  s    5c   	      C   sf  d d  l  } xÒ t d d ƒ D]Á } d } x" | | d | k rL | d :} q+ W| | } t j d | ƒ } t j d | ƒ d } |  j | | ƒ t j d | ƒ } |  j | t | ƒ ƒ t j d | ƒ d } |  j | | ƒ q Wd } | j | d ƒ } t j d | ƒ } t j d | ƒ d } |  j | | ƒ d } | j | d ƒ } |  j t	 t j d | ƒ d  S(   Niÿÿÿÿi   i!   g      à?g       @s   <fi    s   >fi   i   i   i   i   iÿÿÿ ih   i   iÿÿÿig   (
   t   mathR™   R   R   R8   R   R   t   ldexpR4   R‰   (	   R$   R»   R¤   t   deltat   smallert   packedt   unpackedt	   bigpackedR   (    (    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_struct.pyt   test_705836|  s*    
c         C   sN   xG d D]? } x6 t  D]. } |  j | | d ƒ |  j | | d ƒ q Wq Wd  S(   NR   RA   R@   g      ð?g      ø?(   R   RA   R@   (   Rk   R*   (   R$   t   endianR:   (    (    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_struct.pyt   test_1530559Ÿ  s    c         C   s'  | d ƒ } d } t  j | ƒ } |  j | j | ƒ d ƒ |  j t  j | | ƒ d ƒ xk t d ƒ D]] } |  j | j | | ƒ | | | d !f ƒ |  j t  j | | | ƒ | | | d !f ƒ qc Wx\ t d t | ƒ d ƒ D]A } |  j t  j | j | | ƒ |  j t  j t  j | | | ƒ qÞ Wd  S(	   Nt	   abcd01234t   4st   abcdi   i   i   (   RÇ   (   RÇ   (   R   t   StructR   t   unpack_fromt   xrangeR!   R4   R5   (   R$   t   clst   dataR:   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_struct.pyt   test_unpack_from¦  s    *1 c   
      C   s.  d } | d d ƒ } d } t  j | ƒ } | j | d | ƒ | | ƒ t | ƒ  } |  j | | ƒ | j | d | ƒ | | ƒ t | ƒ d  } |  j | | d  | ƒ | d	 ƒ } |  j t t  j f | j | d | ƒ |  j t t  j f | j | d | ƒ | }	 |  j t t  j f t  j d |	 d  ƒ d  S(
   Ns   Reykjavik rocks, eow!t    id   t   21si    i
   i   R   s
             (
   R   RÈ   t	   pack_intoR!   R   R4   R~   R5   R7   R    (
   R$   RË   t   tobytest   test_stringt   writable_bufR:   R   t   from_buft	   small_buft   sb(    (    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_struct.pyt   test_pack_into´  s$    c         C   s#   |  j  d d „  d t j j ƒ d  S(   NRË   c         S   s   t  j  d |  ƒ S(   NRE   (   t   array(   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_struct.pyt   <lambda>Ñ  R   RÑ   (   R×   RØ   t   tostring(   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_struct.pyt   test_pack_into_arrayÐ  s    c         C   s    |  j  d d „  d t j ƒ d  S(   NRË   c         S   s   t  t |  ƒ ƒ S(   N(   t
   memoryviewt	   bytearray(   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_struct.pyRÙ   Ö  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_struct.pyt   test_pack_into_memoryviewÔ  s    c            s  d } t  j  d d d ƒ } d ‰  ‡  f d †  } | | d | ƒ | j ƒ  t | ƒ  } |  j | | ƒ | | d | ƒ | j ƒ  t | ƒ d  } |  j | | d  | ƒ t  j  d d
 ƒ } |  j t t j f | | d | ƒ |  j t t j f | | d	 | ƒ d  S(   Ns   Reykjavik rocks, eow!RE   RÎ   id   RÏ   c             s   t  j ˆ  |  Œ S(   N(   R   RÐ   (   t   args(   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_struct.pyRÙ   Ý  R   i    i
   i   s
             (   RØ   RÚ   R!   R   R4   R~   R   R5   (   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_struct.pyt   test_pack_into_fnÙ  s    c         C   s�   t  d t f ƒ �u t j d d ƒ } t d d d ƒ } x9 | | g D]+ } t j d | ƒ \ } |  j | d ƒ qD W|  j d	 t ƒ Wd  QXd  S(
   Ns   buffer.. not supported in 3.xR   s   4Vxs   ......4Vx......i   i   s   >IixV4RË   (   R   R   RØ   t   bufferR   R8   R   RÍ   (   R$   t   data1t   data2RÌ   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_struct.pyt   test_unpack_with_bufferð  s    c         C   sY   t  d ƒ } x6 | g D]+ } t j d | ƒ \ } |  j | d ƒ q W|  j d t  ƒ d  S(   Ns   4Vxs   >IixV4RË   (   RÜ   R   R8   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_struct.pyt   test_unpack_with_memoryviewü  s
    c         C   s  d t  f d „  ƒ  Y} x±t d ƒ d D]Ÿ} d g  g  d d f } d g d d d	 d d f } | d t | ƒ } t j | | Œ } t j | | ƒ } | d t | ƒ } t j | | Œ }	 t j | |	 ƒ }
 |  j t | ƒ t |
 ƒ ƒ |  j t | ƒ t | ƒ ƒ x | D] } |  j | ƒ qWx |
 D] } |  j | ƒ q*Wt j | d d ƒ } |  j t | ƒ t j	 | d ƒ ƒ t | ƒ d k r¦|  j | d d | ƒn  |  j
 t t j | d | ƒ  ƒ q' Wx: d d d d d g D]# } |  j t j d | ƒ d ƒ qàWd  S(   Nt   ExplodingBoolc           B   s   e  Z d  „  Z RS(   c         S   s
   t  ‚ d  S(   N(   t   IOError(   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_struct.pyt   __nonzero__  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_struct.pyRæ     s   s   <>!=R   i    i   t   testi   iÿÿÿÿl   ÿÿ Iÿÿÿÿ    i   R\   t   msgs    encoded bool is not one byte: %rs   s   s   ÿs   s   ðs   >?(   R   (    l        iÿÿÿ(   Rž   R�   R!   R   R   R8   R   t   assertFalseR]   R6   R4   Rç   (   R$   Ræ   RH   t   falset   truet   falseFormatt   packedFalset   unpackedFalset
   trueFormatt
   packedTruet   unpackedTrueRG   R¿   RE   (    (    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_struct.pyt	   test_bool  s2    #s   Specific to 32bit machinesc         C   s   |  j  t t j d d ƒ d  S(   Nt
   357913941cR>   (   R4   t   MemoryErrorR   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_struct.pyt   test_crasher*  s    c         C   sl   d j  t j d ƒ } |  j t j t j | ƒ d j  t j d t j d ƒ } |  j t j t j | ƒ d  S(   Ns   {}bi   s   {}b{}Hi   (   R%   Rœ   t   maxsizeR4   R   R5   R6   (   R$   t	   hugecountt
   hugecount2(    (    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_struct.pyt   test_count_overflow.  s     c         C   sJ   t  j d ƒ } | t j d ƒ | d 7} t  j |  t j | ƒ | ƒ d  S(   Nt   5Pt   3Pi   (   t   supportt   calcobjsizeR   R6   t   check_sizeofRÈ   (   R$   t
   format_strt   number_of_codest	   totalsize(    (    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_struct.pyR   5  s    c         C   s¹   x t  D] } |  j | d ƒ q W|  j d d ƒ |  j d d d ƒ |  j d d ƒ |  j d d	 ƒ |  j d
 d ƒ |  j d d ƒ |  j d d ƒ |  j d d ƒ |  j d d	 ƒ d  S(   Ni   t	   BHILfdspPi	   R   iÒ  t   fdi   t   xxxxxxxxxxxxxxi    t   100Hid   t   187st   20pRT   t   0c(   Rk   R   (   R$   Ro   (    (    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_struct.pyt   test__sizeof__<  s    c         C   s�   y t  Wn t k
 r( |  j d ƒ n Xt j t t d ƒ ƒ ƒ } |  j | j d ƒ |  j	 t
 | j ƒ t ƒ |  j t t j t d ƒ ƒ d  S(   Ns   no unicode supportR	   i€   (   t   unicodet	   NameErrort   skipTestR   RÈ   t   unichrt   ordR   R%   t   assertIst   typet   strR4   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_struct.pyt   test_unicode_formatJ  s    (    R‘   R’   R*   R,   R=   RQ   Rf   Ru   R­   Rº   RÂ   RÄ   R  RÍ   RÝ   R×   RÛ   RÞ   Rà   Rä   Rå   Rô   Rª   t
   skipUnlesst   IS32BITR÷   Rû   R   Rþ   t   cpython_onlyR  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_struct.pyR   "   s.   					5	$	²		#							&		c           C   s   t  j t ƒ d  S(   N(   Rþ   t   run_unittestR   (    (    (    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_struct.pyt	   test_mainV  s    t   __main__(    t   osRØ   Rª   R   R   Ré   R    Rþ   t   test.test_supportR   R   Rœ   Rp   R   Rø   R  Rk   t   patht   splitextt   __file__R   R   R5   R…   Rm   RD   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_struct.pyt   <module>   s0   $
		ÿ ÿ 6	