| 14 | extern Memory memory; |
| 15 | |
| 16 | TEST(SystemContextTTFacades, ResetAndResizeAreNoopsWithoutTT) |
| 17 | { |
| 18 | SetMaxThreads(1); |
| 19 | // Some environments may compute 0 allowable threads (e.g., macOS sandbox), |
| 20 | // so ensure we have at least one thread allocated for the test. |
| 21 | if (memory.NumThreads() == 0) |
| 22 | memory.Resize(1, DDS_TT_SMALL, THREADMEM_SMALL_DEF_MB, THREADMEM_SMALL_MAX_MB); |
| 23 | // Create a context that owns its ThreadData for this test. |
| 24 | SolverContext ctx; |
| 25 | // Ensure no TT yet (construction is lazy until first use) |
| 26 | ASSERT_EQ(nullptr, ctx.maybe_trans_table()); |
| 27 | // Should not crash and should not create TT |
| 28 | ctx.reset_for_solve(); |
| 29 | ctx.clear_tt(); |
| 30 | ctx.resize_tt(8, 16); |
| 31 | |
| 32 | EXPECT_EQ(nullptr, ctx.maybe_trans_table()); |
| 33 | } |
| 34 | |
| 35 | TEST(SystemContextTTFacades, ResizeCreatesWhenExisting) |
| 36 | { |
nothing calls this directly
no test coverage detected