Skip to content

Commit 873c7dd

Browse files
committed
add test for Task destructor to validate termination on invalid pipeline order
1 parent c097cec commit 873c7dd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

modules/core/performance/tests/perf_tests.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,17 @@ TEST(PerfTest, GetStringParamNameTest) {
314314
EXPECT_EQ(GetStringParamName(ppc::core::PerfResults::kPipeline), "pipeline");
315315
EXPECT_EQ(GetStringParamName(ppc::core::PerfResults::kNone), "none");
316316
}
317+
318+
TEST(TaskTest, Destructor_InvalidPipelineOrderTerminates_PartialPipeline) {
319+
testing::FLAGS_gtest_death_test_style = "threadsafe";
320+
auto test_func = [&] {
321+
struct BadTask : ppc::core::Task<int, int> {
322+
bool ValidationImpl() override { return true; }
323+
bool PreProcessingImpl() override { return true; }
324+
bool RunImpl() override { return true; }
325+
bool PostProcessingImpl() override { return true; }
326+
} task;
327+
task.Validation();
328+
};
329+
ASSERT_DEATH_IF_SUPPORTED({ test_func(); }, "ORDER OF FUNCTIONS IS NOT RIGHT");
330+
}

0 commit comments

Comments
 (0)