Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Some error in test suite : cmdAH-16.3

Closed / Fixed438808ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-07-05 16:42:09
Found some problems in the test suit :
Found on HPUX 11 and 10.20


cmdAH.test
==== cmdAH-16.3 Tcl_FileObjCmd: readable FAILED
==== Contents of test case:
    file readable gorp.file
---- Result was:
1
---- Result should have been:
0
==== cmdAH-16.3 FAILED

Corrected by : 
cmdAH.test.patch
1013c1013
< testchmod 444 gorp.file
---
> testchmod 0444 gorp.file
1017c1017
< testchmod 333 gorp.file
---
> testchmod 0333 gorp.file
1027c1027
< testchmod 555 gorp.file
---
> testchmod 0555 gorp.file
1031c1031
< testchmod 222 gorp.file
---
> testchmod 0222 gorp.file
1052c1052
<     testchmod 775 gorp.file
---
>     testchmod 0775 gorp.file 

Because in fact, the C command strtol detect itself 
the base from the 'string' disregarding the 'base'
parameter ...

So this patch add only 0 in front of the mode so strtol
detects strings as OctalBased number .

This problem exists in 8.3.3 too.

---
Free&ALter Soft
 - Xavier & Damien
http://www.freealter.com
dgp Ticket [438808ffff]: 1 change [History diff]2001-07-06 02:22:41
dkf Ticket [438808ffff]: 1 change [History diff]2001-07-06 16:20:33
dkf Closed ticket [438808ffff]. [History diff]2001-07-06 16:30:32
dgpplain2001-07-07 01:07:26
Logged In: YES 
user_id=80530

I see the changes to the test suite were committed, but
if the failure is in HPUX's strtol(), shouldn't we
detect that failure in unix/configure and replace it
with our compat/strtol() ?
roxplain2001-07-07 01:37:56
Logged In: YES 
user_id=59260

I've test this program on Linux and HPUX11 :
<---->
#include <stdio.h>
#include <stdlib.h>
 
int main ()
{ long int result;
#define TEST(chaine,base) result=strtol(chaine,NULL,base); \
        fprintf(stdout,"Testing with\"%s\",%i => %li:[ %xi ]
\n",chaine, base,result,result)
 
TEST("333",0);  TEST("333",8);   TEST("333",10);  
TEST("333",16);
TEST("0333",0); TEST("0333",8);  TEST("0333",10); 
TEST("0333",16);
TEST("0x333",0);TEST("0x333",8); TEST("0x333",10);
TEST("0x333",16);
return EXIT_SUCCESS;
} 
<---->
And this is the result :
Linux :
Testing with"333",0 => 333:[ 14di ]
Testing with"333",8 => 219:[ dbi ]
Testing with"333",10 => 333:[ 14di ]
Testing with"333",16 => 819:[ 333i ]
Testing with"0333",0 => 219:[ dbi ]
Testing with"0333",8 => 219:[ dbi ]
Testing with"0333",10 => 333:[ 14di ]
Testing with"0333",16 => 819:[ 333i ]
Testing with"0x333",0 => 819:[ 333i ]
Testing with"0x333",8 => 0:[ 0i ]
Testing with"0x333",10 => 0:[ 0i ]
Testing with"0x333",16 => 819:[ 333i ]

And for HP11:
Testing with"333",0 => 333:[ 14di ]
Testing with"333",8 => 219:[ dbi ]
Testing with"333",10 => 333:[ 14di ]
Testing with"333",16 => 819:[ 333i ]
Testing with"0333",0 => 219:[ dbi ]
Testing with"0333",8 => 219:[ dbi ]
Testing with"0333",10 => 333:[ 14di ]
Testing with"0333",16 => 819:[ 333i ]
Testing with"0x333",0 => 819:[ 333i ]
Testing with"0x333",8 => 0:[ 0i ]
Testing with"0x333",10 => 0:[ 0i ]
Testing with"0x333",16 => 819:[ 333i ]


So EXACTLY the SAME !!! 
So it wasn't an error in strtol in HPUX11

What is it ? I don't already know , but I know what it isn't
...

Try to had more precise later ... ( When I've got some
little time to test this more hard ... )
Log in (anonymous is fine) to add a comment.