diff options
| author | Codex <codex@localhost> | 2026-11-22 00:21:48 +0100 |
|---|---|---|
| committer | Codex <codex@localhost> | 2026-11-22 00:21:48 +0100 |
| commit | bb65ea6c35b9e67e7d6883a647a013fbc580c708 (patch) | |
| tree | e28d27caf360158aa68df38f3c33c0adf328185b /runtime/test/descriptor_table_test.cpp | |
| parent | 8bd0087d2d0e45fc18fa78fb40b70ecfc6648854 (diff) | |
runtime: require idle for bindless key replacements
Diffstat (limited to 'runtime/test/descriptor_table_test.cpp')
| -rw-r--r-- | runtime/test/descriptor_table_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/test/descriptor_table_test.cpp b/runtime/test/descriptor_table_test.cpp index 40cc1d159..eb8d884d5 100644 --- a/runtime/test/descriptor_table_test.cpp +++ b/runtime/test/descriptor_table_test.cpp | |||
| @@ -106,6 +106,20 @@ int test_load_factor_and_growth() { | |||
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | int test_insert_reports_mapping_changes() { | ||
| 110 | DescriptorTable table; | ||
| 111 | const DescriptorKey key{1, 2, 3, 4, 5, 6, 7, 8}; | ||
| 112 | using Result = DescriptorTable::InsertResult; | ||
| 113 | |||
| 114 | EXPECT(table.insert_or_update(key.data(), 0) == Result::added); | ||
| 115 | EXPECT(table.insert_or_update(key.data(), 0) == Result::unchanged); | ||
| 116 | EXPECT(table.insert_or_update(key.data(), 17) == Result::replaced); | ||
| 117 | EXPECT(table.insert_or_update(key.data(), 17) == Result::unchanged); | ||
| 118 | EXPECT(table.lookup(key) == 17); | ||
| 119 | EXPECT(table.size() == 1); | ||
| 120 | return 0; | ||
| 121 | } | ||
| 122 | |||
| 109 | int test_probe_collision_resolution() { | 123 | int test_probe_collision_resolution() { |
| 110 | DescriptorTable table(64); | 124 | DescriptorTable table(64); |
| 111 | 125 | ||
| @@ -273,6 +287,7 @@ int main() { | |||
| 273 | EXPECT(test_fnv1a_hash_matches_contract() == 0); | 287 | EXPECT(test_fnv1a_hash_matches_contract() == 0); |
| 274 | EXPECT(test_ssharp_key_padding() == 0); | 288 | EXPECT(test_ssharp_key_padding() == 0); |
| 275 | EXPECT(test_basic_insertion_and_lookup() == 0); | 289 | EXPECT(test_basic_insertion_and_lookup() == 0); |
| 290 | EXPECT(test_insert_reports_mapping_changes() == 0); | ||
| 276 | EXPECT(test_load_factor_and_growth() == 0); | 291 | EXPECT(test_load_factor_and_growth() == 0); |
| 277 | EXPECT(test_probe_collision_resolution() == 0); | 292 | EXPECT(test_probe_collision_resolution() == 0); |
| 278 | EXPECT(test_gpu_buffer_serialization() == 0); | 293 | EXPECT(test_gpu_buffer_serialization() == 0); |