This commit is contained in:
2026-08-16 00:07:05 +08:00
parent 7a94264c13
commit 893be8d2c6
21 changed files with 363 additions and 211 deletions
@@ -280,6 +280,25 @@ TEST(render_graph_runtime_test,
EXPECT_EQ(source.operation().status(), External_Operation_Status::cancelled);
}
TEST(render_graph_runtime_test, idle_cancellation_does_not_arm_next_execution) {
const auto plan = two_node_plan();
std::vector<Node_Execution> execution_storage;
auto slots = execution_slots(*plan, execution_storage);
renderive::render_graph::detail::Render_Graph_Runtime runtime(*plan);
runtime.cancel_pending();
std::atomic<int> executed{};
EXPECT_NO_THROW(runtime.execute(
slots, [&](std::size_t, Node_Execution_Metrics*) {
executed.fetch_add(1, std::memory_order_relaxed);
return Node_Execution_Result::completed();
}));
EXPECT_EQ(executed.load(std::memory_order_relaxed), 2);
EXPECT_EQ(execution_storage[0].status, Node_Execution_Status::complete);
EXPECT_EQ(execution_storage[1].status, Node_Execution_Status::complete);
}
TEST(external_operation_test, completion_commit_is_exclusive_with_cancellation) {
External_Operation_Source source;
const auto operation = source.operation();