错误处理

This commit is contained in:
2026-08-16 17:53:46 +08:00
parent 00a3c54820
commit 8612b5ff86
47 changed files with 744 additions and 544 deletions
@@ -60,18 +60,20 @@ TEST(external_operation_test, completion_before_subscription_is_delivered_once)
}
TEST(external_operation_test,
callback_exceptions_are_contained_for_both_completion_orders) {
callback_exceptions_propagate_for_both_completion_orders) {
External_Operation_Source completed_first;
const auto completed_operation = completed_first.operation();
ASSERT_TRUE(completed_first.complete());
EXPECT_NO_THROW(completed_operation.on_complete(
[](External_Operation_Completion) { throw std::runtime_error("late callback"); }));
EXPECT_THROW(completed_operation.on_complete(
[](External_Operation_Completion) {
throw std::runtime_error("late callback");
}), std::runtime_error);
External_Operation_Source subscribed_first;
const auto subscribed_operation = subscribed_first.operation();
subscribed_operation.on_complete(
[](External_Operation_Completion) { throw std::runtime_error("early callback"); });
EXPECT_TRUE(subscribed_first.complete());
EXPECT_THROW(static_cast<void>(subscribed_first.complete()), std::runtime_error);
}
TEST(render_graph_runtime_test, reusable_topology_executes_multiple_frames) {