Tcl Source Code

Check-in [8eed2203b6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bug #3547593: fcmd test failures on Windows 7 WOW64
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 8eed2203b6607a4346df3a5d8c3cd8f8ec8fa26c
User & Date: jan.nijtmans 2012-07-23 14:20:15
Context
2012-07-23
14:45
use backslash and braces in regexp check-in: 247c77fb0f user: jan.nijtmans tags: core-8-5-branch
14:26
merge-mark check-in: f90ce88076 user: jan.nijtmans tags: trunk
14:20
Bug #3547593: fcmd test failures on Windows 7 WOW64 check-in: 8eed2203b6 user: jan.nijtmans tags: core-8-5-branch
2012-07-20
08:43
merge-mark check-in: 8c75ef0d5f user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/winFCmd.test.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}

# Initialise the test constraints

testConstraint win2000orXP 0
testConstraint winOlderThan2000 0
testConstraint testvolumetype [llength [info commands testvolumetype]]
testConstraint testfile       [llength [info commands testfile]]
testConstraint testchmod      [llength [info commands testchmod]]
testConstraint cdrom 0
testConstraint exdev 0
testConstraint longFileNames 0








<
<







13
14
15
16
17
18
19


20
21
22
23
24
25
26
if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}

# Initialise the test constraints



testConstraint testvolumetype [llength [info commands testvolumetype]]
testConstraint testfile       [llength [info commands testfile]]
testConstraint testchmod      [llength [info commands testchmod]]
testConstraint cdrom 0
testConstraint exdev 0
testConstraint longFileNames 0

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
	}
	if {$x != ""} {
	    catch {file delete -force -- {*}$x}
	}
    }
}

if {[testConstraint winOnly]} {
    if {[testConstraint nt] && [string index $tcl_platform(osVersion) 0]==5} {
	# Warning: Win 6 will break this!
	testConstraint win2000orXP 1
    } else {
	testConstraint winOlderThan2000 1
    }
}

# find a CD-ROM so we can test read-only filesystems.

proc findfile {dir} {
    foreach p [glob -directory $dir *] {
        if {[file type $p] == "file"} {
	    return $p
	}







<
<
<
<
<
<
<
<
<







46
47
48
49
50
51
52









53
54
55
56
57
58
59
	}
	if {$x != ""} {
	    catch {file delete -force -- {*}$x}
	}
    }
}










# find a CD-ROM so we can test read-only filesystems.

proc findfile {dir} {
    foreach p [glob -directory $dir *] {
        if {[file type $p] == "file"} {
	    return $p
	}
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
    cleanup
    createfile tf1
    set fd [open tf2 w]
    set msg [list [catch {testfile mv tf1 tf2} msg] $msg]
    close $fd
    set msg
} {1 EACCES}
test winFCmd-1.13 {TclpRenameFile: errno: EACCES} {win win2000orXP testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 EINVAL}
test winFCmd-1.13.1 {TclpRenameFile: errno: EACCES} {win nt winOlderThan2000 testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 EACCES}
test winFCmd-1.13.2 {TclpRenameFile: errno: ENOENT} {win 95 testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 ENOENT}
test winFCmd-1.14 {TclpRenameFile: errno: EACCES} {win 95 testfile} {
    cleanup
    createfile tf1
    list [catch {testfile mv tf1 nul} msg] $msg
} {1 EACCES}
test winFCmd-1.15 {TclpRenameFile: errno: EEXIST} {win nt testfile} {
    cleanup







|


|
<
<
<
<
<
<
<
<







173
174
175
176
177
178
179
180
181
182
183








184
185
186
187
188
189
190
    cleanup
    createfile tf1
    set fd [open tf2 w]
    set msg [list [catch {testfile mv tf1 tf2} msg] $msg]
    close $fd
    set msg
} {1 EACCES}
test winFCmd-1.13 {TclpRenameFile: errno: EINVAL|EACCES|ENOENT} -constraints {win testfile} -body {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} -match regexp -result {1 (EINVAL|EACCES|ENOENT)}








test winFCmd-1.14 {TclpRenameFile: errno: EACCES} {win 95 testfile} {
    cleanup
    createfile tf1
    list [catch {testfile mv tf1 nul} msg] $msg
} {1 EACCES}
test winFCmd-1.15 {TclpRenameFile: errno: EEXIST} {win nt testfile} {
    cleanup
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
    cleanup
    list [catch {testfile mv tf1 tf2} msg] $msg
} {1 ENOENT} 
test winFCmd-1.18 {TclpRenameFile: srcAttr == -1} {win testfile} {
    cleanup
    list [catch {testfile mv tf1 tf2} msg] $msg
} {1 ENOENT} 
test winFCmd-1.19 {TclpRenameFile: errno == EACCES} {win win2000orXP testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 EINVAL}
test winFCmd-1.19.1 {TclpRenameFile: errno == EACCES} {win nt winOlderThan2000 testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 EACCES}
test winFCmd-1.19.2 {TclpRenameFile: errno == ENOENT} {win 95 testfile} {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} {1 ENOENT}
test winFCmd-1.20 {TclpRenameFile: src is dir} {win nt testfile} {
    # under 95, this would actually succeed and move the current dir out from 
    # under the current process!
    cleanup
    file delete /tf1
    list [catch {testfile mv [pwd] /tf1} msg] $msg
} {1 EACCES}







|


|
<
<
<
<
<
<
<
<







201
202
203
204
205
206
207
208
209
210
211








212
213
214
215
216
217
218
    cleanup
    list [catch {testfile mv tf1 tf2} msg] $msg
} {1 ENOENT} 
test winFCmd-1.18 {TclpRenameFile: srcAttr == -1} {win testfile} {
    cleanup
    list [catch {testfile mv tf1 tf2} msg] $msg
} {1 ENOENT} 
test winFCmd-1.19 {TclpRenameFile: errno == EINVAL|EACCES|ENOENT} -constraints {win testfile} -body {
    cleanup
    list [catch {testfile mv nul tf1} msg] $msg
} -match regexp -result {1 (EINVAL|EACCES|ENOENT)}








test winFCmd-1.20 {TclpRenameFile: src is dir} {win nt testfile} {
    # under 95, this would actually succeed and move the current dir out from 
    # under the current process!
    cleanup
    file delete /tf1
    list [catch {testfile mv [pwd] /tf1} msg] $msg
} {1 EACCES}
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
    cleanup
    createfile tf1
    set fd [open tf2 w]
    set msg [list [catch {testfile cp tf1 tf2} msg] $msg]
    close $fd
    set msg
} {1 EACCES}
test winFCmd-2.8 {TclpCopyFile: errno: EACCES} {win win2000orXP testfile} {
    cleanup
    list [catch {testfile cp nul tf1} msg] $msg
} {1 EINVAL}
test winFCmd-2.8.1 {TclpCopyFile: errno: EACCES} {win nt winOlderThan2000 testfile} {
    cleanup
    list [catch {testfile cp nul tf1} msg] $msg
} {1 EACCES}
test winFCmd-2.9 {TclpCopyFile: errno: ENOENT} {win 95 testfile} {
    cleanup
    list [catch {testfile cp nul tf1} msg] $msg
} {1 ENOENT}
test winFCmd-2.10 {TclpCopyFile: CopyFile succeeds} {win testfile} {
    cleanup
    createfile tf1 tf1
    testfile cp tf1 tf2
    list [contents tf1] [contents tf2]
} {tf1 tf1}
test winFCmd-2.11 {TclpCopyFile: CopyFile succeeds} {win testfile} {







|


|
<
<
<
<
<
<
<
<







346
347
348
349
350
351
352
353
354
355
356








357
358
359
360
361
362
363
    cleanup
    createfile tf1
    set fd [open tf2 w]
    set msg [list [catch {testfile cp tf1 tf2} msg] $msg]
    close $fd
    set msg
} {1 EACCES}
test winFCmd-2.8 {TclpCopyFile: errno: EINVAL|EACCES|ENOENT} -constraints {win testfile} -body {
    cleanup
    list [catch {testfile cp nul tf1} msg] $msg
} -match regexp -result {1 (EINVAL|EACCES|ENOENT)}








test winFCmd-2.10 {TclpCopyFile: CopyFile succeeds} {win testfile} {
    cleanup
    createfile tf1 tf1
    testfile cp tf1 tf2
    list [contents tf1] [contents tf2]
} {tf1 tf1}
test winFCmd-2.11 {TclpCopyFile: CopyFile succeeds} {win testfile} {
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
} {0}
test winFCmd-7.13 {TraverseWinTree: append \ to target if necessary} {win testfile} {
    cleanup
    file mkdir td1
    createfile td1/tf1 tf1
    testfile cpdir td1 td2
    contents td2/tf1
} {tf1}    
test winFCmd-7.14 {TraverseWinTree: append \ to target if necessary} {win 95 testfile} {
    cleanup
    file mkdir td1
    list [catch {testfile cpdir td1 /} msg] $msg
} {1 {/ EEXIST}}
test winFCmd-7.15 {TraverseWinTree: append \ to target if necessary} {win nt testfile} {
    cleanup
    file mkdir td1
    list [catch {testfile cpdir td1 /} msg] $msg
} {1 {/ EACCES}}
test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} {win testfile} {
    cleanup
    file mkdir td1
    testfile cpdir td1 td2
} {}
test winFCmd-7.17 {TraverseWinTree: recurse on files: one file} {win testfile} {
    cleanup







|
|



|
<
<
<
<
<







702
703
704
705
706
707
708
709
710
711
712
713
714





715
716
717
718
719
720
721
} {0}
test winFCmd-7.13 {TraverseWinTree: append \ to target if necessary} {win testfile} {
    cleanup
    file mkdir td1
    createfile td1/tf1 tf1
    testfile cpdir td1 td2
    contents td2/tf1
} {tf1}
test winFCmd-7.14 {TraverseWinTree: append \ to target if necessary} -constraints {win testfile} -body {
    cleanup
    file mkdir td1
    list [catch {testfile cpdir td1 /} msg] $msg
} -match regexp -result {1 {/ EEXIST|EACCES}}





test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} {win testfile} {
    cleanup
    file mkdir td1
    testfile cpdir td1 td2
} {}
test winFCmd-7.17 {TraverseWinTree: recurse on files: one file} {win testfile} {
    cleanup