@@ -49,8 +49,9 @@ void ppc::core::Task::InternalOrderTest(const std::string& str) {
4949
5050 for (size_t i = 0 ; i < functions_order_.size (); i++) {
5151 if (functions_order_[i] != right_functions_order_[i % right_functions_order_.size ()]) {
52- throw std::invalid_argument (" ORDER OF FUCTIONS IS NOT RIGHT: \n " + std::string (" Serial number: " ) +
53- std::to_string (i + 1 ) + " \n " + std::string (" Yours function: " ) + functions_order_[i] +
52+ functions_order_validation_ = false ;
53+ throw std::invalid_argument (" ORDER OF FUNCTIONS IS NOT RIGHT: \n " + std::string (" Serial number: " ) +
54+ std::to_string (i + 1 ) + " \n " + std::string (" Your function: " ) + functions_order_[i] +
5455 " \n " + std::string (" Expected function: " ) + right_functions_order_[i]);
5556 }
5657 }
@@ -76,9 +77,20 @@ void ppc::core::Task::InternalOrderTest(const std::string& str) {
7677}
7778
7879ppc::core::Task::~Task () {
79- if (functions_order_ != right_functions_order_ ) {
80- std::cerr << " ORDER OF FUNCTIONS IS NOT RIGHT: Task functions order is invalid \n " ;
80+ if (functions_order_. empty () ) {
81+ std::cerr << " ORDER OF FUNCTIONS IS NOT RIGHT: No task functions were executed \n " ;
8182 std::terminate ();
8283 }
84+ if (functions_order_validation_) {
85+ for (size_t i = 0 ; i < functions_order_.size (); i++) {
86+ if (functions_order_[i] != right_functions_order_[i % right_functions_order_.size ()]) {
87+ std::cerr << " ORDER OF FUNCTIONS IS NOT RIGHT: \n "
88+ << std::string (" Serial number: " ) << std::to_string (i + 1 ) << " \n "
89+ << std::string (" Your function: " ) << functions_order_[i] << " \n "
90+ << std::string (" Expected function: " ) << right_functions_order_[i] << " \n " ;
91+ std::terminate ();
92+ }
93+ }
94+ }
8395 functions_order_.clear ();
8496}
0 commit comments