23 Commits

Author SHA1 Message Date
Jeroen van Rijn
a1be1b63d5 [core:hash] Add CCITT CRC-16 2025-10-21 16:33:07 +02:00
Jeroen van Rijn
3a7e4873cd Fix #5498
Also:
- Expands `tests/core/hash`
- Fixes bug found in `#hash(s, "murmur64")`
2025-07-25 12:00:24 +02:00
gingerBill
3d984d75cc Add #+feature dynamic-literals to tests 2025-01-05 14:00:23 +00:00
Feoramund
1a52cf1f1c Use test's random generator
This removes the `create` calls when a test was only setting up a
generator, and it replaces them with `reset` when run in a loop.
2024-06-15 15:49:05 -04:00
gingerBill
7ec17ecf98 Update core:math/rand to use context.random_generator and remove rand.Rand 2024-06-15 15:33:24 +01:00
Jeroen van Rijn
8d93379e29 Factor benchmarks out into tests\benchmark\<pkg> 2024-06-02 14:54:29 -04:00
Jeroen van Rijn
39fd73fe17 Port testing\core\hash 2024-06-02 14:47:08 -04:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
Jeroen van Rijn
b99940f33a [xxhash] For the streaming tests, randomly select the size to use.
Randomize size used with `update`.

It'll print "Using user-selected seed {18109872483301276539,2000259725719371} for update size randomness."

If a streaming test then fails, you can repeat it using:
`odin run . -define:RAND_STATE=18109872483301276539 -define:RAND_INC=2000259725719371`
2022-05-02 19:20:25 +02:00
Jeroen van Rijn
6985181961 [xxhash] Add tests for large inputs
Test XXH32, XXH64, XXH3-64 and XXH3-128 for large inputs, with both all-at-once and streaming APIs.

XXH32_create_state and XXH64_create_state now implicitly call their "reset state" variants to simplify the streaming API to 3 steps:
- create state / defer destroy
- update
- digest (finalize)

These are tested with an array of 1, 2, 4, 8 and 16 megabytes worth of zeroes.
All return the same hashes as do both the one-shot version, as well as that of the official xxhsum tool.

3778/3778 tests successful.
2022-05-02 17:51:39 +02:00
Jeroen van Rijn
6d7217f37a [varint] Add LEB128 decoding + tests
Also make tests in general less spammy: Don't print [PASS] for each successful test, only report failures and progress.
2022-03-08 15:40:00 +01:00
Jeroen van Rijn
6d9f84ba03 [tests] Make test runners exit with errorlevel 1 if a test fails. 2022-03-03 15:16:16 +01:00
Jeroen van Rijn
6e22a6dfa5 hash: Smaller CRC-64 ISO 3306 table. 2021-09-21 16:28:35 +02:00
Jeroen van Rijn
181eabcffc hash: Add CRC-64 (ISO 3306) and inverse. 2021-09-21 16:17:01 +02:00
Jeroen van Rijn
b600ffba3b Correct CRC-64 (ECMA 182) & add CRC-64 (XZ) and tests. 2021-09-21 15:17:23 +02:00
Jeroen van Rijn
b6d0a8fe0c xxhash: Add tests for streaming input. 2021-09-15 23:32:48 +02:00
Jeroen van Rijn
a641ef95c0 Add XXH3-64 + tests. 2021-09-13 20:58:26 +02:00
Jeroen van Rijn
ada3be05fb xxhash: typo. 2021-09-12 12:14:49 +02:00
Jeroen van Rijn
36a2cf0369 xxhash: Add custom secret tests. 2021-09-12 12:11:39 +02:00
Jeroen van Rijn
00c1d34108 xxhash: Extra (generated) tests. 2021-09-11 23:45:08 +02:00
Jeroen van Rijn
eaefbc43cb xxhash: Add XXH3_128 + test vectors. 2021-09-11 15:28:49 +02:00
Jeroen van Rijn
e5652da6da Fix typo. 2021-09-09 16:57:58 +02:00
Jeroen van Rijn
637685316d Add xxhash tests to CI. 2021-09-09 16:01:44 +02:00