Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-10-27
03:29 • Closed ticket [767676ffff]: Patch for failing tests plus 7 other changes artifact: 47eb89f0de user: davygrvy
02:20 • Ticket [767676ffff]: 4 changes artifact: 384548d197 user: andreas_kupries
02:20 • Ticket [767676ffff]: 1 change artifact: b3172cd6ab user: andreas_kupries
2003-07-08
18:08 • Ticket [767676ffff]: 4 changes artifact: 35e60b3c08 user: hgiese
18:08 • Add attachment tclPipe_c.diff to ticket [767676ffff] artifact: 129e57502f user: hgiese
11:08 • New ticket [767676ffff] Patch for failing tests. artifact: 9eedc1a277 user: hgiese

Patch for failing tests

Closed / Fixed767676ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2003-07-08 11:08:32
Hello out there,
on Win98 there are 4 failing tests in winpipe.test (not
Borland specific). They all follow this pattern:

==== winpipe-4.2 Tcl_WaitPid: return of exception
codes, SIGFPE FAILED
==== Contents of test case:

    set f [open "|[tcltest::interpreter]" w+]
    set pid [pid $f]
    puts $f "testexcept float_underflow"
    set status [catch {close $f}]
    list $status [expr {$pid == [lindex $::errorCode
1]}] [lindex $::errorCode 2]

---- Result was:
1 0 SIGFPE
---- Result should have been (exact matching):
1 1 SIGFPE

The reason:
- On Win9x PIDs are *large* values (like 0xFFFFhhhh)
- TclCleanupChildren() (in tclpipe.c) uses
TclFormatInt() to convert the PID to a string,
resulting in something like -5432.
- [pid ...] aparently returns an unsigned int (or its
string equivalent)
- and the test on equality fails.

The patch proposes to do instead (see the attached diff
file)

#ifdef __WIN32__
        sprintf(msg1, "%lu", resolvedPid);
#else
        TclFormatInt(msg1, (long) resolvedPid);
#endif

(and the equivalent for msg2).

I used a conditional __WIN32__, however it seems to me
that on *any* platform the PID should be considered
unsigned, so IMHO there is no need for a conditional.
Best regards
Helmut Giese
hgieseplain2003-07-08 18:08:32
File Added - 55236: tclPipe_c.diff
andreas_kupries Ticket [767676ffff]: 1 change [History diff]2004-10-27 02:20:04
andreas_kupriesplain2004-10-27 02:20:05
Logged In: YES 
user_id=75003

David, does this make sense ?
davygrvyplain2004-10-27 03:29:13
Logged In: YES 
user_id=7549

fixed. committed to HEAD
Log in (anonymous is fine) to add a comment.

Attachments: