Tk Library Source Code

View Ticket
Login
Ticket UUID: 714214
Title: test failures: fileutils module
Type: Bug Version: None
Submitter: patthoyts Created on: 2003-04-02 22:08:28
Subsystem: fileutil Assigned To: andreas_kupries
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2007-08-09 02:49:18
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2007-08-08 19:49:18
Description:
Test platform: tcl 8.4.2 on intel Windows 2000

Module:fileutil
modules/fileutil/fileutil.test
fileutil 1.4

==== fileType-1.14 test binary graphic png FAILED
==== Contents of test case:

    set f [file join $dir fileTypeTest pngFile]
    set res [catch {fileutil::fileType $f} msg]
    list $res $msg

---- Result was:
0 binary
---- Result should have been (exact matching):
0 {binary graphic png}
==== fileType-1.14 FAILED


==== fileType-1.21 test binary compressed gzip FAILED
==== Contents of test case:

    set f [file join $dir fileTypeTest gzipFile]
    set res [catch {fileutil::fileType $f} msg]
    list $res $msg

---- Result was:
0 binary
---- Result should have been (exact matching):
0 {binary compressed gzip}
==== fileType-1.21 FAILED
User Comments: andreas_kupries added on 2007-08-09 02:49:18:
Logged In: YES 
user_id=75003
Originator: NO

I do not get these errors when I tested the CVS head on Windows today. I have some other failures for install and relative path computations, but not for file type. Closing.

andreas_kupries added on 2006-10-03 02:26:57:
Logged In: YES 
user_id=75003

Pat, is this still an issue with the current Tcllib CVS head ?

andreas_kupries added on 2003-04-03 06:36:31:
Logged In: YES 
user_id=75003

Added a fix to the testsuite which circumvents binary data 
issues in 'makeFile'.

andreas_kupries added on 2003-04-03 06:32:15:
Logged In: YES 
user_id=75003

The testsuite creates a number of files which are then tested. 
The creation step already fails. The bytes 0x89 and 0x8b are 
both stored as 0x3f. The command used is 'tcltest::makeFile'.

Now writing the files explicitly, using -encoding binary.
Now the testsuite works. This is a problem in whatever tcltest 
you are using. ... Mine is 2.2.2. We have to talk to Don Porter 
now.

andreas_kupries added on 2003-04-03 05:57:20:
Logged In: YES 
user_id=75003

Relevant code section:

    } elseif { $binary && [string match "\x1f\x8b*" $test] } {
        lappend type compressed gzip

    } elseif { $binary && [string match "\x89PNG*" $test] } {
        lappend type graphic png

It seems that the string match'es fail. (The 'binary' is 
correctely detected, so the flag $binary is set).

Reproduced on my Windows 2000 system. IOW, deeper 
digging can be done locally. ... dump hex of pattern and data

andreas_kupries added on 2003-04-03 05:50:32:
Logged In: YES 
user_id=75003

Checking ... not so for Linux. Seems to be windows 
specific. "file type" code ... That is something we got from 
Phil Ehrens.