summaryrefslogtreecommitdiff
path: root/test-suite/standalone/test-hashing.c
diff options
context:
space:
mode:
authorRob Browning <rlb@defaultvalue.org>2024-07-01 02:14:37 -0500
committerRob Browning <rlb@defaultvalue.org>2024-07-12 17:49:45 -0500
commitad1f56675be58fbb7bfee6fab166ff5bf0b36a11 (patch)
tree9eac4816ca92785abf1d5381bcaebbe26530ab28 /test-suite/standalone/test-hashing.c
parentd99ae68f882947a962a8911655fa8104bb24e124 (diff)
downloadguile-ad1f56675be58fbb7bfee6fab166ff5bf0b36a11.tar.gz
test-hashing: support 32-bit
* test-suite/standalone/test-hashing.c (test_hashing): add expected value for 32-bit architectures.
Diffstat (limited to 'test-suite/standalone/test-hashing.c')
-rw-r--r--test-suite/standalone/test-hashing.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test-suite/standalone/test-hashing.c b/test-suite/standalone/test-hashing.c
index 5982a0fdb..50e132989 100644
--- a/test-suite/standalone/test-hashing.c
+++ b/test-suite/standalone/test-hashing.c
@@ -38,9 +38,15 @@ test_hashing ()
// Value determined by calling wide_string_hash on {0x3A0, 0x3B5,
// 0x3C1, 0x3AF} via a temporary test program.
+#if SIZEOF_UNSIGNED_LONG == 8
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)
{
fprintf (stderr, "fail: unexpected utf-8 symbol hash (%lu != %lu)\n",