Ticket #457 (new bug) — at Initial Version

Opened 13 years ago

Last modified 11 years ago

t/pmc/os.t has invalid stat() and lstat() tests.

Reported by: doughera Owned by:
Priority: normal Milestone:
Component: none Version:
Severity: medium Keywords:
Cc: jkeen@… Language:
Patch status: Platform:

Description

TT #325 incorrectly put a "TODO" on the stat() and lstat() tests for Solaris in t/pmc/os.t. stat() and lstat() work fine on Solaris. The problem is that the test is wrong. It erroneously assumes that the st_dev value reported by one program (parrot, in this case) is necessarily the same as the st_dev value reported by another program (perl, in this case) that might have been compiled in a different mode. Specifically, on Solaris, the default system perl is compiled in 32-bit mode. If parrot is compiled in 64-bit mode, it will get a different 'st_dev' value. That's not a problem because, according to the Solaris man page for stat(2):

Its value may be used as input to the ustat() function to determine more information about this file system. No other meaning is associated with this value.

The fix is "simple": t/pmc/os.t should only compare the last 12 entries returned by stat, not all 13. Alas, I don't know how to do that in PIR.

This problem is not necessarily specific to Solaris, though that's the platform where a mix of models is most likely to be encountered.

If no one has the time to fix the tests, they should probably be skipped. Currently, it can result in spurious passing TODOs if perl and parrot happen to have been compiled in the same mode.

Change History

Changed 13 years ago by doughera

Simple patch to skip bad stat() tests.

Note: See TracTickets for help on using tickets.