Lines Matching refs:ok

65 $ok=  ! $h1  &&  Win32API::File::_fileLastError() == 2; # could not find the file
66 $ok or print "# ","".fileLastError(),"\n";
67 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 2
68 if( ! $ok ) { CloseHandle($h1); unlink("ReadOnly.txt"); }
70 $ok= $h1= createFile( "ReadOnly.txt", "wcn", { Attributes=>"r" } );
71 $ok or print "# ",fileLastError(),"\n";
72 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 3
74 $ok= WriteFile( $h1, "Original text\n", 0, [], [] );
75 $ok or print "# ",fileLastError(),"\n";
76 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 4
79 $ok= ! $h2 && Win32API::File::_fileLastError() == 80; # file exists
80 $ok or print "# ",fileLastError(),"\n";
81 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 5
82 if( ! $ok ) { CloseHandle($h2); }
85 $ok= ! $h2 && Win32API::File::_fileLastError() == 5; # access is denied
86 $ok or print "# ",fileLastError(),"\n";
87 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 6
88 if( ! $ok ) { CloseHandle($h2); }
90 $ok= $h2= createFile( "ReadOnly.txt", "r" );
91 $ok or print "# ",fileLastError(),"\n";
92 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 7
94 $ok= SetFilePointer( $h1, length("Original"), [], FILE_BEGIN );
95 $ok or print "# ",fileLastError(),"\n";
96 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 8
98 $ok= WriteFile( $h1, "ly was other text\n", 0, $len, [] )
100 $ok or print "# <$len> should be <",
102 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 9
104 $ok= ReadFile( $h2, $text, 80, $len, [] )
106 $ok or print "# <$len> should be <",length($text),
108 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 10
110 $ok= $text eq "Originally was other text\n";
111 if( !$ok ) {
115 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 11
117 $ok= CloseHandle($h2);
118 $ok or print "# ",fileLastError(),"\n";
119 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 12
121 $ok= ! ReadFile( $h2, $text, 80, $len, [] )
123 $ok or print "# ",fileLastError(),"\n";
124 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 13
128 $ok= $h1= createFile( "CanWrite.txt", "rw", FILE_SHARE_WRITE,
130 $ok or print "# ",fileLastError(),"\n";
131 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 14
133 $ok= WriteFile( $h1, "Just this and not this", 10, [], [] );
134 $ok or print "# ",fileLastError(),"\n";
135 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 15
137 $ok= $h2= createFile( "CanWrite.txt", "wk", { Share=>"rw" } );
138 $ok or print "# ",fileLastError(),"\n";
139 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 16
141 $ok= OsFHandleOpen( "APP", $h2, "wat" );
142 $ok or print "# ",fileLastError(),"\n";
143 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 17
145 $ok= $h2 == GetOsFHandle( "APP" );
146 $ok or print "# $h2 != ",GetOsFHandle("APP"),"\n";
147 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 18
150 $ok= print APP "is enough\n";
151 $ok or print "# ",fileLastError(),"\n";
152 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 19
156 $ok= ReadFile( $h1, $text, 0, [], [] );
157 $ok or print "# ",fileLastError(),"\n";
158 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 20
160 $ok= $text eq "is enough\r\n";
161 if( !$ok ) {
166 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 21
170 $ok = 1;
175 $ok = -e "CanWrite.txt" && $! =~ /permission denied/i;
176 $ok or print "# $!\n";
178 print $ok ? "" : "not ", "ok ", ++$test, "$skip\n"; # ok 22
184 $ok= ! DeleteFile( "ReadOnly.txt" )
186 $ok or print "# ",fileLastError(),"\n";
187 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 23
189 $ok= ! CopyFile( "ReadOnly.txt", "CanWrite.txt", 1 )
191 $ok or print "# ",fileLastError(),"\n";
192 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 24
194 $ok= ! CopyFile( "CanWrite.txt", "ReadOnly.txt", 0 )
196 $ok or print "# ",fileLastError(),"\n";
197 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 25
199 $ok= ! MoveFile( "NoSuchFile", "NoSuchDest" )
201 $ok or print "# ",fileLastError(),"\n";
202 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 26
204 $ok= ! MoveFileEx( "NoSuchFile", "NoSuchDest", 0 )
206 $ok or print "# ",fileLastError(),"\n";
207 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 27
209 $ok= ! MoveFile( "ReadOnly.txt", "CanWrite.txt" )
211 $ok or print "# ",fileLastError(),"\n";
212 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 28
214 $ok= ! MoveFileEx( "ReadOnly.txt", "CanWrite.txt", 0 )
216 $ok or print "# ",fileLastError(),"\n";
217 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 29
219 $ok= CopyFile( "ReadOnly.txt", "ReadOnly.cp", 1 )
221 $ok or print "# ",fileLastError(),"\n";
222 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 30
224 $ok= ! MoveFileEx( "CanWrite.txt", "ReadOnly.cp", MOVEFILE_REPLACE_EXISTING )
227 $ok or print "# ",fileLastError(),"\n";
228 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 31
230 $ok= MoveFileEx( "ReadOnly.cp", "CanWrite.cp", MOVEFILE_REPLACE_EXISTING );
231 $ok or print "# ",fileLastError(),"\n";
232 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 32
234 $ok= MoveFile( "CanWrite.cp", "Moved.cp" );
235 $ok or print "# ",fileLastError(),"\n";
236 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 33
238 $ok= ! unlink( "ReadOnly.cp" )
242 $ok or print "# $!\n";
243 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 34
245 $ok= ! DeleteFile( "Moved.cp" )
247 $ok or print "# ",fileLastError(),"\n";
248 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 35
257 $ok= DeleteFile( "Moved.cp" );
258 $ok or print "# ",fileLastError(),"\n";
259 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 36
266 $ok= $old == $reold;
267 $ok or print "# $old != $reold: ",fileLastError(),"\n";
268 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 37
270 $ok= ($renew&$new) == $new;
271 $ok or print "# $new != $renew: ",fileLastError(),"\n";
272 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 38
274 $ok= @drives= getLogicalDrives();
275 $ok && print "# @drives\n";
276 $ok or print "# ",fileLastError(),"\n";
277 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 39
279 $ok= $drives[0] !~ /^[ab]/ || DRIVE_REMOVABLE == GetDriveType($drives[0]);
280 $ok or print "# ",DRIVE_REMOVABLE," != ",GetDriveType($drives[0]),
282 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 40
286 $ok= 1 == grep /^\Q$drive\E/i, @drives;
287 $ok or print "# No $drive found in list of drives.\n";
288 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 41
290 $ok= DRIVE_FIXED == GetDriveType( $drive );
291 $ok or print
293 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 42
295 $ok= GetVolumeInformation( $drive, $vol, 64, $ser, $max, $flag, $fs, 16 );
296 $ok or print "# ",fileLastError(),"\n";
297 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 43
301 $ok= QueryDosDevice( $drive, $dev, 80 );
302 $ok or print "# $drive: ",fileLastError(),"\n";
303 if( $ok ) {
307 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 44
319 $ok= DefineDosDevice( 0, $let, $ENV{WINDIR} );
320 $ok or print "# $let,$ENV{WINDIR}: ",fileLastError(),"\n";
321 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 45
323 $ok= -s $let."/Win.ini" == -s $ENV{WINDIR}."/Win.ini";
324 $ok or print "# ", -s $let."/Win.ini", " vs. ",
326 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 46
328 $ok= DefineDosDevice( DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE,
330 $ok or print "# $let,$ENV{WINDIR}: ",fileLastError(),"\n";
331 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 47
333 $ok= ! -f $let."/Win.ini"
335 $ok or print "# $!\n";
336 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 48
338 $ok= DefineDosDevice( DDD_RAW_TARGET_PATH, $let, $dev );
339 if( !$ok ) {
343 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 49
346 $ok= -f $let.substr($path,$^O eq 'cygwin'?2:3)."/win.ini";
347 $ok or print "# ",$let.substr($path,3)."/win.ini ",fileLastError(),"\n";
348 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 50
350 $ok= DefineDosDevice( DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE
352 $ok or print "# $let,$dev: ",fileLastError(),"\n";
353 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 51
356 $ok= $attrs != INVALID_FILE_ATTRIBUTES;
357 $ok or print "# $path gave invalid attribute value, attrs=$attrs: ",fileLastError(),"\n";
358 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 52
360 $ok= ($attrs & FILE_ATTRIBUTE_DIRECTORY);
361 $ok or print "# $path not a directory, attrs=$attrs: ",fileLastError(),"\n";
362 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 53
366 $ok= $attrs != INVALID_FILE_ATTRIBUTES;
367 $ok or print "# $path gave invalid attribute value, attrs=$attrs: ",fileLastError(),"\n";
368 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 54
370 $ok= !($attrs & FILE_ATTRIBUTE_DIRECTORY);
371 $ok or print "# $path is a directory, attrs=$attrs: ",fileLastError(),"\n";
372 print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 55
397 $ok= ! eval("$func(0,0)") && $@ =~ /(::|\s)_?${func}A?[(:\s]/;
399 $ok= ! eval("$func()") && $@ =~ /(::|\s)_?${func}A?[(:\s]/;
401 $ok or print "# $func: $@\n";
402 print $ok ? "" : "not ", "ok ", ++$test, "\n";
407 $ok= ! eval("$func()") && $@ =~ /::_?${func}\(/;
409 $ok or print "# $func: $@\n";
410 print $ok ? "" : "not ", "ok ", ++$test, "\n";
414 $ok= eval("my \$x= $const(); 1");
415 $ok or print "# Constant $const: $@\n";
416 print $ok ? "" : "not ", "ok ", ++$test, "\n";