[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] test-hashing: support 32-bit
From: |
Rob Browning |
Subject: |
[PATCH 4/6] test-hashing: support 32-bit |
Date: |
Mon, 1 Jul 2024 21:45:18 -0500 |
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
---
test-suite/standalone/test-hashing.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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",
--
2.43.0
- [PATCH 0/6] A handful of post 3.0.10 fixups, Rob Browning, 2024/07/01
- [PATCH 3/6] Add guile-procedures.txt to BUILT_SOURCES, Rob Browning, 2024/07/01
- [PATCH 1/6] define-meta-command: mention effects of a missing category, Rob Browning, 2024/07/01
- [PATCH 4/6] test-hashing: support 32-bit,
Rob Browning <=
- [PATCH 2/6] Ensure GUILE-VERSION changes propagate to .version and Makefiles, Rob Browning, 2024/07/01
- [PATCH 5/6] scm_i_utf8_string_hash: don't overrun when len is zero, Rob Browning, 2024/07/01
- [PATCH 6/6] scm_i_utf8_string_hash: optimize ASCII, Rob Browning, 2024/07/01