Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r505:42c220319de5 Date: 2012-06-24 18:17 +0200 http://bitbucket.org/cffi/cffi/changeset/42c220319de5/
Log: Make the test more robust. diff --git a/c/test_c.py b/c/test_c.py --- a/c/test_c.py +++ b/c/test_c.py @@ -215,9 +215,17 @@ BChar = new_primitive_type("char") BInt = new_primitive_type("int") BFloat = new_primitive_type("float") - assert (hash(cast(BChar, 'A')) != - hash(cast(BInt, 65))) - assert hash(cast(BFloat, 65)) != hash(65.0) + for i in range(1, 20): + if (hash(cast(BChar, chr(i))) != + hash(cast(BInt, i))): + break + else: + raise AssertionError("hashes are equal") + for i in range(1, 20): + if hash(cast(BFloat, i)) != hash(float(i)): + break + else: + raise AssertionError("hashes are equal") def test_no_len_on_nonarray(): p = new_primitive_type("int") _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit