Fix bug while getting step number.
[anna.git] / example / diameter / launcher / testing / TestCase.hpp
index a3b653d..ab8e4a3 100644 (file)
@@ -12,6 +12,7 @@
 // Standard
 #include <string>
 #include <vector>
+#include <map>
 
 // Project
 #include <anna/core/DataBlock.hpp>
@@ -108,6 +109,8 @@ public:
 
   //helpers
   int steps() const throw() { return a_steps.size(); }
+  void addStep(TestStep *step) throw() { a_steps[1+steps()] = step; }
+
   TestStepWait *searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw();
       // When a message arrives, we identify the test case by mean the Session-Id. Then, from the current step iterator (included),
       //  we search for a fulfilling condition for that message. The first found, is 'completed' and then breaks the search.
@@ -120,8 +123,8 @@ public:
 private:
   // private members:
   unsigned int a_id;
-  std::vector<TestStep*> a_steps;
-  std::vector<TestStep*>::const_iterator a_stepsIt;
+  std::map<int/* step number*/, TestStep*> a_steps;
+  std::map<int/* step number*/, TestStep*>::const_iterator a_stepsIt;
   std::map<anna::diameter::HopByHop, TestStep*> a_hopByHops; // for wait-answer
   State::_v a_state;
   anna::Millisecond a_startTime;