Solve legacy problem with clear operation (coredump with running threads)
[anna.git] / include / anna / testing / TestCase.hpp
index 6ec64ad..3ebd535 100644 (file)
@@ -78,6 +78,7 @@ public:
   bool isFinished() const throw() { return (getState() == State::Failed || getState() == State::Success); }
   bool inProgress() const throw() { return (getState() == State::InProgress); }
   bool isFailed() const throw() { return (getState() == State::Failed); }
+  bool isSuccess() const throw() { return (getState() == State::Success); }
   bool hasSameCondition(const TestDiameterCondition &condition) const throw();
   const DebugSummary & getDebugSummary() const throw() { return a_debugSummary; }
 
@@ -118,6 +119,9 @@ public:
   // Reset test case and underlaying information (steps context)
   bool reset(bool hard /* hard reset includes in-progress test cases */) throw();
 
+  // Check for clear (destroy steps)
+  bool safeToClear(); // false if something pending (running threads steps)
+
   // getters
   const unsigned int &getId() const throw() { return a_id; }
   const std::string &getDescription() const throw() { return a_description; }