File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -245,12 +245,16 @@ class Task {
245
245
bool was_worked_ = false ;
246
246
247
247
bool IsFullPipelineStage () {
248
+ if (functions_order_.size () < 4 ) {
249
+ return false ;
250
+ }
251
+
248
252
auto it = std::adjacent_find (functions_order_.begin () + 2 ,
249
253
functions_order_.begin () + static_cast <long >(functions_order_.size () - 2 ),
250
254
std::not_equal_to<>());
251
255
252
- return (functions_order_. size () >= 4 && functions_order_[0 ] == " Validation " &&
253
- functions_order_[1 ] == " PreProcessing " && functions_order_[ 2 ] == " Run" &&
256
+ return (functions_order_[ 0 ] == " Validation " && functions_order_[1 ] == " PreProcessing " &&
257
+ functions_order_[2 ] == " Run" &&
254
258
it == (functions_order_.begin () + static_cast <long >(functions_order_.size () - 2 )) &&
255
259
functions_order_[functions_order_.size () - 1 ] == " PostProcessing" );
256
260
}
Original file line number Diff line number Diff line change @@ -154,6 +154,25 @@ TEST_NOLINT(task_tests, check_empty_order_disabled_valgrind) {
154
154
EXPECT_DEATH_IF_SUPPORTED (destroy_function (), " .*ORDER OF FUNCTIONS IS NOT RIGHT.*" );
155
155
}
156
156
157
+ TEST_NOLINT (task_tests, premature_postprocessing_no_steps) {
158
+ auto destroy_function = [] {
159
+ std::vector<float > in (20 , 1 );
160
+ ppc::test::task::TestTask<std::vector<float >, float > test_task (in);
161
+ ASSERT_NO_THROW (test_task.PostProcessing ());
162
+ };
163
+ EXPECT_DEATH_IF_SUPPORTED (destroy_function (), " .*ORDER OF FUNCTIONS IS NOT RIGHT.*" );
164
+ }
165
+
166
+ TEST_NOLINT (task_tests, premature_postprocessing_after_preprocessing) {
167
+ auto destroy_function = [] {
168
+ std::vector<float > in (20 , 1 );
169
+ ppc::test::task::TestTask<std::vector<float >, float > test_task (in);
170
+ ASSERT_NO_THROW (test_task.PreProcessing ());
171
+ ASSERT_NO_THROW (test_task.PostProcessing ());
172
+ };
173
+ EXPECT_DEATH_IF_SUPPORTED (destroy_function (), " .*ORDER OF FUNCTIONS IS NOT RIGHT.*" );
174
+ }
175
+
157
176
int main (int argc, char **argv) {
158
177
testing::InitGoogleTest (&argc, argv);
159
178
return RUN_ALL_TESTS ();
You can’t perform that action at this time.
0 commit comments