�
B��cc @ s� 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 Td � Z d e j f d � � YZ e
d k r� e j � n d S( i����N( t hexlify( t *c C s t t | � � j � S( N( R t
memoryviewt upper( t s( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt bin s t Testc B s� e Z e j d � d � � Z d � Z d � Z d � Z d � Z d � Z d � Z
d � Z d � Z d
� Z
d � Z d � Z RS(
s
test disabledc C sR t j t j IJx; t d � D]- } t � } t | d | d � t | � q Wd S( Ni s i%si ( t syst stderrt byteordert ranget BITSt setattrt dump( t selft it bits( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_X s
c C s� t j d k r; | j t j t � | j t j j t � n) | j t j t � | j t j j t � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � d S( Nt littlei4 s >ht 1234s <ht 3412( R R t assertIst c_shortt __ctype_le__t __ctype_be__t assertEqualR t structt packt valuet c_ushort( R R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_short s* """"c C s� t j d k r; | j t j t � | j t j j t � n) | j t j t � | j t j j t � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � d S( NR ixV4s >it 12345678s <it 78563412s >Is <I( R R R t c_intR R R R R R R t c_uint( R R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_int4 s* """"c C s� t j d k r; | j t j t � | j t j j t � n) | j t j t � | j t j j t � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � t j d � } | j t t j d d � � d � | j t | � d � | j | j
d � d S( NR I�ͫ�xV4s >qt 1234567890ABCDEFs <qt EFCDAB9078563412s >Qs <Q( R R R t
c_longlongR R R R R R R t c_ulonglong( R R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_longlongP s* """"c C sg t j d k r; | j t j t � | j t j j t � n) | j t j t � | j t j j t � t t j � } | j t t
j d t j � � t | � � | j | j
t j d � t j t j � } | j | j
t j d � | j t t
j d t j � � t | � � t j t j � } | j | j
t j d � | j t t
j d t j � � t | � � d S( NR t fi s <fs >f( R R R t c_floatR R t matht piR R R R t assertAlmostEqualR ( R R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_floatl s ++c C s^ t j d k r; | j t j t � | j t j j t � n) | j t j t � | j t j j t � t t j � } | j | j t j � | j t
t j d t j � � t
| � � t j t j � } | j | j t j � | j t
t j d t j � � t
| � � t j t j � } | j | j t j � | j t
t j d t j � � t
| � � d S( NR t ds <ds >d(
R R R t c_doubleR R R+ R, R R R R R ( R R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_double~ s ++c C sv | j t j t � | j t j t � | j t j t � | j t j t � | j t j t � | j t j t � d S( N( R t c_byteR R t c_ubytet c_char( R ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyt test_endian_other� s c C s` t j d k r t } n t } d | f d � � Y} d t f d t f d t f d t f d t f d t f d
t
f d t f d t f d
t
f d t f d t f d t f d t d f d t d f d t d f d t d d d f g } | | _ xh t t t t � f D]Q } | j d | f � d | f d � � Y} | j t t | d d | f g � qWd S( NR t Tc B s e Z RS( ( t __name__t
__module__( ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyR6 � s t at bt cR/ t eR) t gt hR t kt lt mt nt b1i t b2t b3i t xc B s e Z RS( ( R7 R8 ( ( ( s@ /usr/local/python-2.7/lib/python2.7/ctypes/test/test_byteswap.pyR6 � s t _fields_( R R t BigEndianStructuret LittleEndianStructureR3 R2 R R R! R"