petdance/scratch — Issue #30: t/dynpmc/os.t has invalid stat() and lstat() tests.
Author: petdance
Created: 2011-11-01 05:29:38+00:00
State: open
Labels: bug, Pri-normal, Sev-medium, testing

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/dynpmc/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.

'''UPDATE''': Updated description 2010-09-20 to reflect movement of file from ''t/pmc/'' to ''t/dynpmc''.
Trac ID #457