MCPcopy Create free account
hub / github.com/dds-bridge/dds / TEST

Function TEST

library/tests/system/utilities_log_ctx_ops_test_with_define.cpp:20–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20TEST(UtilitiesLogCtxOpsWithDefine, EmitsCtxAndTTOps)
21{
22 ensure_thread();
23 SolverContext ctx;
24
25 // Start from a clean log buffer
26 ctx.utilities().log_clear();
27
28 // Exercise the newly logged operations
29 ctx.reset_for_solve();
30 ctx.reset_best_moves_lite();
31 ctx.resize_tt(8, 16);
32 ctx.clear_tt();
33
34 const auto& logs = ctx.utilities().log_buffer();
35 // We expect at least the four entries we just invoked
36 ASSERT_GE(logs.size(), 4u);
37
38 bool sawResetForSolve = false;
39 bool sawResetBestMovesLite = false;
40 bool sawResize = false;
41 bool sawClear = false;
42 for (const auto& s : logs) {
43 if (s == "ctx:reset_for_solve") sawResetForSolve = true;
44 if (s == "ctx:reset_best_moves_lite") sawResetBestMovesLite = true;
45 if (s.rfind("tt:resize|", 0) == 0) sawResize = true;
46 if (s == "tt:clear") sawClear = true;
47 }
48
49 EXPECT_TRUE(sawResetForSolve);
50 EXPECT_TRUE(sawResetBestMovesLite);
51 EXPECT_TRUE(sawResize);
52 EXPECT_TRUE(sawClear);
53}

Callers

nothing calls this directly

Calls 8

utilitiesMethod · 0.80
reset_for_solveMethod · 0.80
reset_best_moves_liteMethod · 0.80
resize_ttMethod · 0.80
clear_ttMethod · 0.80
log_bufferMethod · 0.80
ensure_threadFunction · 0.70
log_clearMethod · 0.45

Tested by

no test coverage detected