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