- int steps = a_steps.size();
- int stepIndx = stepNumber - 1;
- if ((stepIndx < 0) || (stepIndx > (a_steps.size()-1)))
- throw anna::RuntimeException(anna::functions::asString("Step number (%d) out of range (test case %llu)", stepNumber, a_id), ANNA_FILE_LOCATION);
+ const TestStep *stepReferred = getStep(stepNumber);
+ if (!stepReferred)
+ throw anna::RuntimeException(anna::functions::asString("Step number (%d) do not exists (test case %llu)", stepNumber, a_id), ANNA_FILE_LOCATION);