MCPcopy Create free account
hub / github.com/arkhipenko/TaskScheduler / TEST_F

Function TEST_F

tests/test-scheduler-uaf-regression.cpp:102–114  ·  view source on GitHub ↗

--------------------------------------------------------------------------- 1. Core regression: task immediately after the deleted task must still run. Chain: A -> B -> C. A deletes B. C must execute. ---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

100// Chain: A -> B -> C. A deletes B. C must execute.
101// ---------------------------------------------------------------------------
102TEST_F(UafRegressionTest, TaskAfterDeletedTaskStillRuns) {
103 Scheduler ts;
104
105 Task taskA(TASK_IMMEDIATE, TASK_ONCE, cbA_delete_one, &ts, true);
106 s_victim1 = new Task(TASK_IMMEDIATE, TASK_ONCE, cbB, &ts, true);
107 Task taskC(TASK_IMMEDIATE, TASK_ONCE, cbC, &ts, true);
108
109 ts.execute();
110
111 EXPECT_EQ(s_a_count, 1) << "Task A should have run";
112 EXPECT_EQ(s_b_count, 0) << "Task B was deleted by A before it could run";
113 EXPECT_EQ(s_c_count, 1) << "Task C must run despite B being deleted mid-iteration";
114}
115
116// ---------------------------------------------------------------------------
117// 2. All tasks beyond the deleted node must run in the same pass.

Callers

nothing calls this directly

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected