tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
P\¬Qc@sÄdZddlZddlZddlZddlZddlZddlmZmZm    Z    m
Z
m Z e dƒZ d„Z e ƒZdejfd„ƒYZd„Zed    krÀeƒndS(
s]Test program for the fcntl C module.
 
OS/2+EMX doesn't support the file locking operations.
 
iÿÿÿÿN(tverbosetTESTFNtunlinkt run_unittestt import_moduletfcntlc
Csitjjdƒrd}n+y tjWntk
r?d}nXd}tjjdƒsgtjdkrÇtjd    ƒd
kr‹d    }d }n d }d    }tj|||d dddt    j
dƒ}n}tjdkrtjdt    j
ddddddƒ}nDtjdkrd}n,tjd |d t    j
dddddƒ}|ret redGt |ƒGHqen|S(Ntatheostqqtlltnetbsdtfreebsdtopenbsdtbsdostdarwintlititlxxxxthhitaix3taix4shp-uxBt    unixware7thhllliitos2emxs struct.pack: (R    R
R R (RRshp-uxBR(sos2emx(tsystplatformt
startswithtost O_LARGEFILEtAttributeErrortstructtcalcsizetpackRtF_WRLCKtNoneRtrepr(t    start_lentoff_ttpid_ttlockdata((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyt get_lockdatas2      
    *    ,t    TestFcntlcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs d|_dS(N(R!tf(tself((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pytsetUp9scCs4|jr&|jj r&|jjƒnttƒdS(N(R)tclosedtcloseRR(R*((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyttearDown<scCs¤ttdƒ|_tj|jjƒtjtjƒ}trHdG|GHnt    j
dkr“tj|jjƒtj t ƒ}tr“dGt |ƒGHq“n|jjƒdS(Ntws#Status from fcntl with O_NONBLOCK: Rs!String from fcntl with F_SETLKW: (sos2emx(topenRR)RtfilenotF_SETFLRt
O_NONBLOCKRRRtF_SETLKWR&R"R-(R*trv((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyttest_fcntl_filenoAs$ !cCsnttdƒ|_tj|jtjtjƒ}tjdkr]tj|jtj    t
ƒ}n|jj ƒdS(NR/R(sos2emx( R0RR)RR2RR3RRR4R&R-(R*R5((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyttest_fcntl_file_descriptorMs
cCs[ddd„ƒY}|jttjdtjtjƒ|jttj|dƒtjtjƒ|jttjdtjtjƒ|jttj|dƒtjtjƒ|jttjtjdtjtjƒ|jttj|tjdƒtjtjƒ|jttjtj    dtjtjƒ|jttj|tj    dƒtjtjƒdS(NtFcBseZd„Zd„ZRS(cSs ||_dS(N(tfn(R*R9((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyt__init__WscSs|jS(N(R9(R*((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyR1Ys(t__name__t
__module__R:R1(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyR8Vs    iÿÿÿÿtspami((
t assertRaisest
ValueErrorRR2RR3t    TypeErrort    _testcapitINT_MAXtINT_MIN(R*R8((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyttest_fcntl_bad_fileUs"("(cCsytj}tj}Wntk
r6|jdƒnXtjtjjtjj    t
ƒƒtj ƒ}ztj|||ƒWdtj |ƒXdS(Ns$F_NOTIFY or DN_MULTISHOT unavailable( RtF_NOTIFYt DN_MULTISHOTRtskipTestRR0tpathtdirnametabspathRtO_RDONLYR-(R*tcmdtflagstfd((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyttest_fcntl_64_bitis      -(R;R<R+R.R6R7RDRO(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyR(7s                     cCsttƒdS(N(RR((((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyt    test_mainyst__main__(t__doc__RRRRAtunittestttest.test_supportRRRRRRR'R&tTestCaseR(RPR;(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_fcntl.pyt<module>s     (          B