in reply to Test and endianness

This is for the purposes of testing only. Correct?

If so, then dodge the bullet. Store your test data file as ASCII.

Within your test script, load the ASCII and pack it using the various "Native format" specifiers.

This will generate your binary data correctly regardless of what platform you run it on. Supply the packed data to your test.

Result: Your tests are platform independent, and you've exercised your binary interpretation routines.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Test and endianness
by andreas1234567 (Vicar) on Jan 16, 2008 at 13:14 UTC
    This is for the purposes of testing only. Correct?
    Yes.
    Within your test script, load the ASCII and pack it using the various "Native format" specifiers.
    That's a very elegant solution indeed. However, I assume GrandFather is correct in his assumption that the SOL files are little-endian regardless of platform.

    If one uses "Native format" specifiers to create the test files, one would get big-endian test files on big-endian platforms. The tests would then no longer reflect real use of the module on those platforms.

    --
    Andreas