|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
#include <stdio.h>#include <string.h>#include <serene/rt/context.h>#include <serene/rt/impl/hashmap.h>#include "acutest.h"#include "base.h"Go to the source code of this file.
Data Structures | |
| struct | hashmap_dummy |
Macros | |
| #define | HMAP_TESTS(X) |
| #define | HMAP_TEST_LOG(...) |
Typedefs | |
| typedef struct hashmap_dummy | hashmap_dummy |
Functions | |
| static void | test_hashmap_empty () |
| void | test_hashmap_insert_kv () |
| static void | test_hashmap_make_sure_hash_is_deterministic () |
| static void | test_hashmap_many_insert_and_lookup () |
| static void | test_hashmap_collision_node_lookup () |
| static hmap_hash_t | test_hash_from_key_bytes (const hmap_t *hmap, const hmap_key_t *k) |
| Hash hook that reads the hash straight from the key's first four bytes, so a test can craft hashes with an exact bit pattern. | |
| static void | test_hashmap_max_depth_divergence () |
| Two keys whose hashes agree on bits 0-29 (every full 5 bit fragment) and differ only in bits 30-31 diverge at the trie's maximum depth. | |
| static void | test_hashmap_update () |
| #define HMAP_TEST_LOG | ( | ... | ) |
Definition at line 39 of file hashmap_tests.h.
| #define HMAP_TESTS | ( | X | ) |
Definition at line 30 of file hashmap_tests.h.
| typedef struct hashmap_dummy hashmap_dummy |
|
static |
Hash hook that reads the hash straight from the key's first four bytes, so a test can craft hashes with an exact bit pattern.
Definition at line 213 of file hashmap_tests.h.
|
static |
Definition at line 177 of file hashmap_tests.h.
|
static |
Definition at line 46 of file hashmap_tests.h.
| void test_hashmap_insert_kv | ( | ) |
Definition at line 59 of file hashmap_tests.h.
|
static |
Definition at line 89 of file hashmap_tests.h.
|
static |
Definition at line 104 of file hashmap_tests.h.
|
static |
Two keys whose hashes agree on bits 0-29 (every full 5 bit fragment) and differ only in bits 30-31 diverge at the trie's maximum depth.
They must end up in separate data slots, not in one collision node keyed by a single bit position. A third key with a fully identical hash must still land in a real collision node next to them.
Definition at line 225 of file hashmap_tests.h.
|
static |
Definition at line 267 of file hashmap_tests.h.