mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
test-hashing: support 32-bit
* test-suite/standalone/test-hashing.c (test_hashing): add expected value for 32-bit architectures.
This commit is contained in:
parent
d99ae68f88
commit
ad1f56675b
1 changed files with 7 additions and 1 deletions
|
@ -38,9 +38,15 @@ test_hashing ()
|
||||||
|
|
||||||
// Value determined by calling wide_string_hash on {0x3A0, 0x3B5,
|
// Value determined by calling wide_string_hash on {0x3A0, 0x3B5,
|
||||||
// 0x3C1, 0x3AF} via a temporary test program.
|
// 0x3C1, 0x3AF} via a temporary test program.
|
||||||
|
#if SIZEOF_UNSIGNED_LONG == 8
|
||||||
const unsigned long expect = 4029223418961680680;
|
const unsigned long expect = 4029223418961680680;
|
||||||
const unsigned long actual = scm_to_ulong (scm_symbol_hash (sym));
|
#elif SIZEOF_UNSIGNED_LONG == 4
|
||||||
|
const unsigned long expect = 938126682;
|
||||||
|
#else
|
||||||
|
#error "unsigned long not 4 or 8 bytes (need additonal test data)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const unsigned long actual = scm_to_ulong (scm_symbol_hash (sym));
|
||||||
if (actual != expect)
|
if (actual != expect)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "fail: unexpected utf-8 symbol hash (%lu != %lu)\n",
|
fprintf (stderr, "fail: unexpected utf-8 symbol hash (%lu != %lu)\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue