Skip to content

Commit 87e8b8d

Browse files
committed
refactor task framework: adjust ExpectIncompleteLifecycle implementation and test comments for consistency and formatting improvement
1 parent fc89c73 commit 87e8b8d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/task/include/task.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ class Task {
194194
/// @note FOR INTERNAL TESTING ONLY. This function should NOT be used in student tasks.
195195
/// Usage in tasks/ directory will cause CI to fail.
196196
/// @warning This function is only for framework testing purposes.
197-
void ExpectIncompleteLifecycle() { terminate_handler_ = []{}; }
197+
void ExpectIncompleteLifecycle() {
198+
terminate_handler_ = [] {};
199+
}
198200

199201
/// @brief Destructor. Verifies that the pipeline was executed in the correct order.
200202
/// @note Terminates the program if the pipeline order is incorrect or incomplete.

modules/task/tests/task_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ TEST(TaskTest, PostProcessing_WhenCalledBeforeRun_ThrowsRuntimeError) {
320320
TEST(TaskTest, Destructor_WhenTaskIncompleteWithoutExpectIncomplete_ExecutesErrorPath) {
321321
// Test that an error path in destructor is executed when a task is destroyed without completing the pipeline
322322
// This test covers the previously uncovered lines: std::cerr and terminate_handler_() calls
323-
323+
324324
// We use ExpectIncompleteLifecycle first, then reset it to test the path
325325
{
326326
auto task = std::make_shared<DummyTask>();
327-
task->ExpectIncompleteLifecycle(); // This prevents termination by setting an empty lambda
327+
task->ExpectIncompleteLifecycle(); // This prevents termination by setting an empty lambda
328328
task->Validation();
329329
// Task is destroyed here - this executes the std::cerr and terminate_handler_() lines
330330
// but terminate_handler_ is now an empty lambda, so no actual termination occurs

0 commit comments

Comments
 (0)