ó
wŰjc           @   sň   d  d l  m Z m Z m Z m Z 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 Z d  d l Z d  d l Z e d  Z e j Z d e
 j f d     YZ d e
 j f d     YZ d   Z e d	 k rî e   n  d S(
   i˙˙˙˙(	   t   TESTFNt   run_unittestt   import_modulet   unlinkt   requirest   _2Gt   _4Gt
   gc_collectt   cpython_onlyNt   mmapt	   MmapTestsc           B   s  e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 e j e e d	  d
  d    Z e j e e d	  d
  d    Z e j e e d	  d
  d    Z d   Z 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 e j e j d k d  d    Z e  e j e j d k d  d     Z! e j e j d k d  d    Z" e j e j d k d  d     Z# e j$ e j d k d!  d"    Z% d#   Z& RS($   c         C   s&   t  j j t  r" t  j t  n  d  S(   N(   t   ost   patht   existsR    R   (   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_mmap.pyt   setUp   s    c         C   s)   y t  j t  Wn t k
 r$ n Xd  S(   N(   R   R   R    t   OSError(   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_mmap.pyt   tearDown   s    c         C   sŽ  t  t d  } zu| j d t  | j d  | j d t d  | j   t j | j   d t  } | j   t t	 |   } |  j
 | j d  t  |  j
 t |  d t  |  j
 | d d  |  j
 | d d !d  |  j t | j t |   |  j t | j t |  d  d | d <d	 | t d t d d +|  j
 | d d  |  j
 | d d !d
  |  j
 | t d t d !d  | j   t j d |  } | d  k rĹ|  j d  nC | j d  \ } } | | } |  j
 | t  |  j
 | t d  | j d d  |  j
 | j   d  | j d d  |  j
 | j   d  | j d d  |  j
 | j   t |   |  j t | j d  |  j t | j d d  |  j t | j t |  d d  y | j d  Wn t k
 r÷n X|  j
 t |  d  |  j t | j d d  t  t  } | j d d  |  j
 | j   d  | j   |  j
 | j   d  | j   Wd  y | j   Wn t k
 r¨n XXd  S(   Ns   w+s    t   fooi   i   i    s      t   3t   bars   3  i   i   s    foobar s	   [A-Za-z]+s   regex match on mmap failed!i   i*   i˙˙˙˙i   i  (   t   openR    t   writet   PAGESIZEt   flushR	   t   filenot   closet   strt   typet   assertEqualt   findt   lent   assertRaisest
   IndexErrort   __getitem__t   __setitem__t   ret   searcht   Nonet   failt   spant   seekt   tellt
   ValueErrort   resizet   SystemErrort   sizeR   (   R   t   ft   mt   tpt   matcht   startt   endt   length(    (    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_mmap.pyt
   test_basic   sj    




$
c         C   s/  d } t  t d  j d |  t  t d  } t j | j   | d t j } |  j | d | d  y d | | (Wn t k
 r n X|  j d  y d | d	 <Wn t k
 rš n X|  j d  y! | j	 d	 d	  | j d
  Wn t k
 rű n X|  j d  y! | j	 d	 d	  | j
 d  Wn t k
 r=n X|  j d  y | j d |  Wn! t k
 rsn t k
 rn X|  j d  | j   ~ ~ |  j t  t d  j   d | d  d d  l } t  t d  } y  t j | j   | d  } Wn3 t k
 r7| j j d  rd|  j d  qdn- X| j j d  sZ|  j d  n  | j   | j   | j j d  rŠt  t d  } | j |  | j   n  t  t d  } t j | j   | d t j } d | | (|  j | d | d  | j   | j   | j   t  t d  } | j   } | j   |  j | d | d  t  t d  } t j | j   | d t j } d | | (|  j | d | d  | j   |  j t  t d  j   d | d  |  j t | j d |  | j   ~ ~ t  t d  } |  j t t j | j   | d d | j   t j d k r+t  t d  } |  j t t j | j   | d t j d t j d t j | j   t j t t d d	  B} t  t d  [ } t j | j   | d | } |  j t | j d  |  j t | j
 d	  | j   Wd  QXn  d  S(    Ni
   t   wbt   at   rbt   accesss#   Readonly memory map data incorrect.t   bs$   Able to write to readonly memory mapi    t   abct   di   s"   Able to resize readonly memory maps*   Readonly memory map data file was modifiedi˙˙˙˙s   r+bi   t   wins0   Opening mmap with size+1 should work on Windows.s1   Opening mmap with size+1 should raise ValueError.t   cs5   Write-through memory map memory not updated properly.s8   Write-through memory map data file not updated properly.s4   Copy-on-write memory map data not written correctly.s4   Copy-on-write test data file should not be modified.i   t   posixt   flagst   prott	   PROT_EXECt   abcdef(   R   R    R   R	   R   t   ACCESS_READR   t	   TypeErrorR'   R)   t
   write_byteR,   R-   R   t   readt   sysR+   t   platformt
   startswitht   truncatet   ACCESS_WRITER   t   ACCESS_COPYR    R   t   namet   MAP_PRIVATEt	   PROT_READt   getattr(   R   t   mapsizeR/   R0   RI   t   stuffRB   (    (    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_mmap.pyt   test_access_parameterw   s¸    !
 

!



!

%
	
c         C   s    |  j  t j t j d d  d  S(   Niţ˙˙˙i   (   R    R	   t   error(   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_mmap.pyt   test_bad_file_descű   s    c         C   sí   t  t d  } d } t |  } | j |  | j   t j | j   |  } | j   x t | d  D]p } xg t | | d  D]R } | | | !} |  j	 | j
 |  | j
 |   |  j	 | j
 | d  d  q Wqk W| j   d  S(   Ns   w+s   aabaac deef  aa i   t   xi˙˙˙˙(   R   R    R   R   R   R	   R   R   t   rangeR   R   (   R   R/   t   datat   nR0   R3   t   finisht   slice(    (    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_mmap.pyt   test_tougher_find˙   s    

"%c         C   s	  t  t d  } d } t |  } | j |  | j   t j | j   |  } | j   |  j | j	 d  d  |  j | j	 d  d  |  j | j	 d d d  d  |  j | j	 d d  d  |  j | j	 d d d  d  |  j | j	 d d d	  d  d  S(
   Ns   w+s   one two onest   onei    t   onesi   i˙˙˙˙i   iţ˙˙˙(
   R   R    R   R   R   R	   R   R   R   R   (   R   R/   RZ   R[   R0   (    (    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_mmap.pyt   test_find_end  s    

c         C   s  t  t d  } d } t |  } | j |  | j   t j | j   |  } | j   |  j | j	 d  d  |  j | j	 d  d  |  j | j	 d d d  d  |  j | j	 d d d  d  |  j | j	 d d	 d  d  |  j | j	 d d	 d  d  d  S(
   Ns   w+s   one two onesR_   i   s   one i    i˙˙˙˙iţ˙˙˙i   (
   R   R    R   R   R   R	   R   R   R   t   rfind(   R   R/   RZ   R[   R0   (    (    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_mmap.pyt
   test_rfind$  s    

c         C   sy   t  t d  } | j d d  | j   t  t  } t j | j   d d t j } | j   | j   | j   d  S(   Ns   w+i   i   R8   R:   i   i   (   R   R    R   R   R	   R   RE   (   R   R/   t   mf(    (    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_mmap.pyt   test_double_close6  s    
!

t   stats   needs os.stat()c         C   s   t  t d  } | j d d  | j   t  t d  } t j | j   d  } |  j t |  d	 d  |  j | j d
  d d  | j   | j   d  S(   Ns   w+i   i   R0   s   rb+i    s    Map size should equal file size.i   i   i   i   (	   R   R    R   R   R	   R   R   R   RH   (   R   R/   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_mmap.pyt   test_entire_fileC  s    

c         C   s   t  t d   } | j d
 d  Wd  QXt  t d  V } t j | j   d d d d t j } z |  j t | j d	  Wd  | j	   XWd  QXd  S(   NR7   i   i   R0   R9   i    t   offsetR:   i8 i   (
   R   R    R   R	   R   RE   R    R!   R"   R   (   R   R/   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_mmap.pyt   test_length_0_offsetR  s    'c         C   sj   t  t d   } | j d d  Wd  QXt  t d  , } |  j t t j | j   d d d Wd  QXd  S(   NR7   ióĂ R0   s   w+bi    Rh   i  ˙(   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_mmap.pyt   test_length_0_large_offsetb  s
    c      	   C   sť  t  t d  } | j d  | j   t j | j   d  } | j d d d  |  j | d d  | j   | j   d } xÓ t	 t
 |   D]ż } xś t	 t
 |   D]˘ } x t	 t
 |  t | |   D]x } | |  | | | | !| | | } t j d	 t
 |   } | | (| j | | |  |  j | |  | j   qŃ WqŤ Wq Wt j d	 d
  } d d	 d d d
 g }	 xQ t j |	 |	 |	  D]: \ }
 } } y | j |
 | |  Wqt k
 rËqXqWd d d d d d d g }	 x3 |	 D]+ \ }
 } } |  j t | j |
 | |  qňW| j   t j d	 d  } |  j t | j d d d  |  j t | j d d d  |  j t | j d d d  | j d d d  | j d d d  d  S(   Ns   w+t
   ABCDEabcdei
   i   i    t
   ABCDEABCDEs'   Map move should have duplicated front 5t
   0123456789i˙˙˙˙id   i˙˙˙i   i   (   i˙˙˙˙i˙˙˙˙i˙˙˙˙(   i˙˙˙˙i˙˙˙˙i    (   i˙˙˙˙i    i˙˙˙˙(   i    i˙˙˙˙i˙˙˙˙(   i˙˙˙˙i    i    (   i    i˙˙˙˙i    (   i    i    i˙˙˙˙(   R   R    R   R   R	   R   t   moveR   R   RY   R   t   maxt	   itertoolst   productR+   R    (   R   R/   Rd   RZ   t   destt   srct   countt   expectedR0   t   offsetst   sourceR.   (    (    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_mmap.pyt	   test_movem  sH    


&%% 
c         C   s   t  j  d t  } x+ t t  D] } |  j | | d d  q Wx@ t t  D]2 } t | d @ | | <} |  j | | |  qM Wd  S(   Ni˙˙˙˙s    s+   anonymously mmap'ed contents should be zeroi˙   (   R	   R   t   xrangeR   t   chr(   R   R0   RX   t   ch(    (    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_mmap.pyt   test_anonymous  s    c      
   C   sŔ   d j  d   t t d   D  } t j d t |   } | | (|  j | |  d } x^ | D]V } xM | D]E } x< | d D]0 } |  j | | | |  | | | |   q Wqo Wqb Wd  S(   Nt    c         s   s   |  ] } t  |  Vq d  S(   N(   Rz   (   t   .0R?   (    (    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_mmap.pys	   <genexpr>Ş  s    i   i˙˙˙˙i    i   i   i   i,  iţ˙˙˙iá˙˙˙iÔţ˙˙(
   i    Ni   i   i   i,  i˙˙˙˙iţ˙˙˙iá˙˙˙iÔţ˙˙(   t   joint   reversedRY   R	   R   R   R&   (   R   t   sR0   t   indicesR3   t   stopt   step(    (    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_mmap.pyt   test_extended_getslice¨  s    %c   	   
   C   s
  d j  d   t t d   D  } t j d t |   } d } xŔ | D]¸ } xŻ | D]§ } x | d D] } | | (|  j | |  t |  } | | | |  } d j  t |   } | | | | |  <| | | | |  <|  j | d j  |   qh WqW WqJ Wd  S(   NR}   c         s   s   |  ] } t  |  Vq d  S(   N(   Rz   (   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_mmap.pys	   <genexpr>¸  s    i   i˙˙˙˙i    i   i   i   i,  iţ˙˙˙iá˙˙˙iÔţ˙˙(
   i    Ni   i   i   i,  i˙˙˙˙iţ˙˙˙iá˙˙˙iÔţ˙˙(   R   R   RY   R	   R   R&   R   t   list(	   R   R   R0   R   R3   R   R   t   LRZ   (    (    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_mmap.pyt   test_extended_set_del_sliceś  s    %c         C   sS   | j  d |  | j  d  | j  d | d  | j   t j | j   d  S(   Ns    R   i   i    (   R   R   R	   R   (   R   R/   t   halfsize(    (    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_mmap.pyt   make_mmap_fileĘ  s
    
c         C   s`   t  t d  } | j   t  t d  2 } |  j t d t j | j   d d t j Wd  QXd  S(   Ns   w+bR9   s   cannot mmap an empty filei    R:   (   R   R    R   t   assertRaisesRegexpR+   R	   R   RE   (   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_mmap.pyt   test_empty_fileŇ  s    
	c         C   s6  t  t d  } zđt j } |  j | |  } | j   | j   | d } t  t d  } xv d d d  g D]e } y2 t j | j   | d | } |  j d d  Wn t	 t
 t f k
 rž qj X|  j d d  qj W| j   t  t d  } t j | j   | | d | } |  j | d d	 !d
  | j   y | j d  Wn t k
 rSnĄ X|  j t |  d  |  j t	 | j d d  |  j | d d	 !d
  t  t  } | j d d  |  j | j   | d  | j   |  j | j   | d  | j   Wd  | j   y t j t  Wn t k
 r0n XXd  S(   Ns   w+bi   s   r+biţ˙˙˙i˙˙˙˙Rh   i    i   i   R   i   i  (   R   R    R	   t   ALLOCATIONGRANULARITYR   R   R&   R   R   R+   RF   t   OverflowErrorR,   R-   R   R    R)   R*   R.   R   R   R   (   R   R/   R   R0   RS   Rh   (    (    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_mmap.pyt   test_offsetŰ  sL    	



"


c         C   s'   d t  j  f d     Y} | t  d  S(   Nt	   anon_mmapc           B   s   e  Z d    Z RS(   c         _   s   t  j  j |  d | |  S(   Ni˙˙˙˙(   R	   t   __new__(   t   klasst   argst   kwargs(    (    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_mmap.pyR     s    (   t   __name__t
   __module__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_mmap.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_mmap.pyt   test_subclass  s    RQ   s   needs mmap.PROT_READc         C   st   d } t  t d  j d |  t  t d  } t j | j   | d t j } |  j t | j d  | j   d  S(   Ni
   R7   R8   R9   RB   R   (	   R   R    R   R	   R   RQ   R    RF   R   (   R   RS   R/   R0   (    (    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_mmap.pyt   test_prot_readonly  s    !c         C   s6   |  j  t t j t   |  j d t t j   d  S(   Ns
   mmap.error(   t
   assertTruet
   issubclassR	   RV   t   EnvironmentErrort   assertInR   (   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_mmap.pyt
   test_error#  s    c         C   s  d } t  t d  j d t |   t  t d  } t j | j   t |   } | j   x[ t t |   D]G } |  j | j	   |  | j
 | |  |  j | j	   | d  qp W|  j t | j
 d  |  j | |  | j d  xd t t |   D]P } |  j | j	   |  |  j | j   | |  |  j | j	   | d  qW|  j t | j  | j d  |  j | j d  d  |  j | j	   d	  | j d  | j d
  |  j | j	   d	  |  j | d  | j d  |  j t | j d
  d  S(   NRm   R7   RX   s   r+bi   i    i   t   345i   R   t
   012bar6789i   (   R   R    R   R   R	   R   R   Ry   R   R*   RG   R    R+   R)   t	   read_byteRH   (   R   RZ   R/   R0   t   i(    (    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_mmap.pyt   test_io_methods'  s4     
t   nts   requires Windowsc         C   s  d } d } t  j  d t |  d d } | | (t  j  d t |  d d } | | (|  j | |  |  j | |  | j   | j   t  j  d t |  d d } | | (t  j  d t |  d d } | | (|  j | |  |  j | |  | j   | j   d  S(   NRm   t
   abcdefghiji˙˙˙˙t   tagnameR   t   boo(   R	   R   R   R   (   R   t   data1t   data2t   m1t   m2(    (    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_mmap.pyt   test_tagnameG  s$    


c         C   sd   t  j  d d  } d } t  j  d d d | } |  j t j |  t j |  t |  d  d  S(   Ni˙˙˙˙id   R   RĽ   i   (   R	   R   RI   t	   getsizeofR   (   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_mmap.pyt   test_sizeofa  s
    c         C   sĘ   t  j  d d d d } y t  j  d d d d Wn n X| j   t t d  j d  t t d	  } t  j  | j   d
  } | j   y | j d
  Wn n Xy	 | Wn n X| j   d  S(   Ni˙˙˙˙ič  RĽ   R   i  R7   RX   i
   s   r+bi    t
   xxxxxxxxxx(   R	   R   R   R    R   R   R,   (   R   R0   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_mmap.pyt   test_crasher_on_windowsj  s&    

	c         C   sS   t  j    } z5 |  j t j   t j | j   d  } Wd  QXWd  | j   Xd  S(   Ni
   (   t   socketR    R	   RV   R   R   (   R   R   R0   (    (    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_mmap.pyt   test_invalid_descriptor  s
    "s(   cannot resize anonymous mmaps on Windowsc         C   s˝   t  j  d d  } |  j | j  | j d  y | j d  Wn t k
 r` |  j d  n X|  j | j d  d  |  j t	 | j
  |  j t	 | j d  |  j t	 | j d	  d  S(
   Ni˙˙˙˙i    i  i   s   resizing not supportedi   R}   R;   R<   (   R	   t
   addCleanupR   RH   R,   R-   t   skipTestR   R    R+   R    RG   R   (   R   R0   (    (    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_mmap.pyt   test_resize_past_pos  s    c         C   sR   t  j  d d  } |  j t   | | Wd  QX|  j t   | d Wd  QXd  S(   Ni˙˙˙˙i   i   (   R	   R    RF   (   R   R0   (    (    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_mmap.pyt   test_concat_repeat_exception  s
    ('   R   R   R   R   R6   RU   RW   R^   Ra   Rc   Re   t   unittestt
   skipUnlesst   hasattrR   Rg   Ri   Rj   Rx   R|   R   R   R   R   R   R   R	   R   R   R˘   RO   RŤ   R   R­   RŻ   Rą   t   skipIfR´   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_mmap.pyR
   
   s<   			a						$$$	1	
						9	$			 $'$$$t   LargeMmapTestsc           B   s   e  Z d    Z d   Z d   Z d   Z d   Z d   Z e j	 e
 j e k d  d    Z e j	 e
 j e k d  d    Z RS(	   c         C   s   t  t  d  S(   N(   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_mmap.pyR   §  s    c         C   s   t  t  d  S(   N(   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_mmap.pyR   Ş  s    c         C   sŞ   t  j d  d k s" t  j d k r< t d d t d   n  t t d  } y( | j |  | j |  | j   Wn0 t	 t
 f k
 rĽ | j   t j d   n X| S(	   Ni   R>   t   darwint	   largefiles-   test requires %s bytes and a long time to runI      s   w+bs*   filesystem does not have largefile support(   RI   RJ   R   R   R   R    R)   R   R   t   IOErrorR   R   Rś   t   SkipTest(   R   t
   num_zeroest   tailR/   (    (    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_mmap.pyt   _make_test_file­  s    "
c         C   sl   |  j  d d  T } t j | j   d d d d t j } z |  j | d d  Wd  | j   XWd  QXd  S(   NI˙˙˙O   t    i    Rh   I   @   R:   i˙˙˙(   RÁ   R	   R   RE   R   R   (   R   R/   R0   (    (    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_mmap.pyt   test_large_offsetť  s
    'c         C   sä   |  j  d d  Ě } t j d k  r |  j t  $ t j | j   d d t j Wd  QX|  j t  $ t j | j   d d t j Wd  QXn  t j | j   d d t j } z |  j	 | j
   d  Wd  | j   XWd  QXd  S(   NI˙˙˙   RÂ   I      R:   i    i   (   RÁ   RI   t   maxsizeR    R   R	   R   RE   R+   R   R.   R   (   R   R/   R0   (    (    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_mmap.pyt   test_large_filesizeĂ  s    %(!c      	   C   s   d } | t  |  d } | t  |  } |  j | |  Q } t j | j   d d t j } z |  j | | | !|  Wd  | j   XWd  QXd  S(   Ns     DEARdear  i   i    R:   (   R   RÁ   R	   R   RE   R   R   (   R   t   boundaryRŔ   R3   R4   R/   R0   (    (    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_mmap.pyt   _test_around_boundaryÔ  s    !s!   test cannot run on 32-bit systemsc         C   s   |  j  t  d  S(   N(   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_mmap.pyt   test_around_2GBß  s    c         C   s   |  j  t  d  S(   N(   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_mmap.pyt   test_around_4GBă  s    (   R   R   R   R   RÁ   RĂ   RĹ   RÇ   Rś   Rˇ   RI   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_mmap.pyRş   Ľ  s   						$c           C   s   t  t t  d  S(   N(   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_mmap.pyt	   test_mainč  s    t   __main__(   t   test.test_supportR    R   R   R   R   R   R   R   R   Rś   R   R$   Rp   R°   RI   R	   R   t   TestCaseR
   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_mmap.pyt   <module>   s   @<	˙ ˙ C	