Skip to content

Commit

Permalink
test: 测试用例增加不存在任务失败检查
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Sep 22, 2024
1 parent de4c6d3 commit ffac9b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/pipeline/module/RunWithoutFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <meojson/json.hpp>

#include <iostream>

#include "MaaFramework/MaaAPI.h"

#ifdef _MSC_VER
Expand Down Expand Up @@ -46,6 +48,15 @@ bool run_without_file(const std::filesystem::path& testset_dir)
MaaTaskerBindResource(tasker_handle, resource_handle);
MaaTaskerBindController(tasker_handle, controller_handle);

{
auto failed_id = MaaTaskerPostPipeline(tasker_handle, "_NotExists_", "{}");
auto failed_status = MaaTaskerWait(tasker_handle, failed_id);
if (failed_id == MaaInvalidId || failed_status != MaaStatus_Failed) {
std::cout << "Failed to detect invalid task" << std::endl;
return false;
}
}

MaaResourceRegisterCustomAction(resource_handle, "MyAct", &my_action, nullptr);

json::value task_param {
Expand Down

0 comments on commit ffac9b9

Please sign in to comment.