mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-27 00:28:49 +03:00
fixed bug
This commit is contained in:
parent
c096b4471c
commit
dd2d98f32d
2 changed files with 14 additions and 5 deletions
|
|
@ -8,7 +8,8 @@ using namespace UnitTest;
|
|||
|
||||
ParameterizedManager::ParameterizedManager()
|
||||
: _currentTest(nullptr),
|
||||
_nextTestBackup(nullptr)
|
||||
_nextTestBackup(nullptr),
|
||||
_iterationDone(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +62,7 @@ void ParameterizedManager::beginExecute(TestDetails const * const details)
|
|||
_currentTest = retrieveTest(details);
|
||||
_nextTestBackup = _currentTest->m_next;
|
||||
_currentTest->m_next = _currentTest; // Loop itself
|
||||
_iterationDone = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -90,20 +92,26 @@ void ParameterizedManager::endExecute(TestDetails const * const details)
|
|||
_currentTest = nullptr;
|
||||
_nextTestBackup = nullptr;
|
||||
}
|
||||
_iterationDone = false;
|
||||
}
|
||||
|
||||
|
||||
ParameterizedManager::RegisterThen ParameterizedManager::registerParameter(ParameterizedTestAbstract* const parameterized)
|
||||
{
|
||||
if (!_stack.empty() && _stack.back() == parameterized)
|
||||
{
|
||||
return RegisterThen::ITERATE;
|
||||
}
|
||||
if (find(_stack.begin(), _stack.end(), parameterized) == _stack.end())
|
||||
{
|
||||
_iterationDone = true;
|
||||
_stack.push_back(parameterized);
|
||||
return RegisterThen::FIRST;
|
||||
}
|
||||
if (!_iterationDone)
|
||||
{
|
||||
if (!_stack.empty() && _stack.back() == parameterized)
|
||||
{
|
||||
_iterationDone = true;
|
||||
return RegisterThen::ITERATE;
|
||||
}
|
||||
}
|
||||
return RegisterThen::IDLE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace UnitTest
|
|||
TestListNode* _currentTest;
|
||||
TestListNode* _nextTestBackup;
|
||||
vector<ParameterizedTestAbstract*> _stack;
|
||||
volatile bool _iterationDone;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue