Repository navigation
Commit 0ee0772
committed
fix(test): correct initial-state assertions in allocation accounting test
GroupValuesPrimitive::new() calls HashTable::with_capacity(128), which
immediately reserves backing storage. The previous assertions treated the
map as unallocated (capacity == 0, allocation_size == 0), causing the
test to fail on the very first check.
Instead, capture the actual nonzero initial allocation_size() returned
by the constructor and assert that:
- map.capacity() >= 128 (matching the with_capacity argument)
- allocation_size() > 0 (pre-allocation is real)
- size() == values.allocated_size() + initial_map_bytes
This makes the focused regression test pass while still exercising the
exact accounting that the broader fix (using allocation_size() instead
of the naive capacity * size_of formula) is meant to validate.1 parent 472fd7d commit 0ee0772
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
333 | 343 | | |
334 | 344 | | |
335 | | - | |
| 345 | + | |
| 346 | + | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
| |||
0 commit comments