New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests/test_rhash.sh portable #8

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@a4lg

a4lg commented Jul 21, 2014

I found some tests fail on some locales (I mainly use LANG=en_US.UTF-8).

The issue is, the way to generate test vector is not portable enough. For instance, on the GNU/Linux environment which LANG=en_US.UTF-8, awk 'BEGIN{printf("%c",0x80)}' prints UTF-8 representation of Unicode codepoint U+0080 (0xc2 0x80) instead of single byte 0x80.

I think the only way to resolve the issue is embed test vectors in the directory as this commit does (maybe you could modify locale-related environment variables but I believe this is the most portable solution).

Make tests/test_rhash.sh portable
This script uses awk to generate binary files but this is not portable
because `printf' prints multibyte characters on some locales
(e.g. en_US.UTF-8).

This commit resolves this issue by embedding test data directly.
@rhash

This comment has been minimized.

Show comment
Hide comment
@rhash

rhash Jul 22, 2014

Owner

Thank you for the fix!

I've incorporated it into master with small change - the 512K test has been removed to decrease a bit the sources tarball size.

Owner

rhash commented Jul 22, 2014

Thank you for the fix!

I've incorporated it into master with small change - the 512K test has been removed to decrease a bit the sources tarball size.

@a4lg a4lg closed this Jul 23, 2014

@a4lg a4lg deleted the a4lg:fix/portable-tests branch Jul 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment