mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
fixed execution failure with Fixture
This commit is contained in:
parent
807cc813fc
commit
60165e44a0
3 changed files with 9 additions and 5 deletions
|
|
@ -21,13 +21,16 @@
|
|||
|
||||
namespace UnitTest {
|
||||
|
||||
//TODO remove template and parameter "templateIsTest", replace with an interface
|
||||
template< typename T >
|
||||
void ExecuteTest(T& testObject, TestDetails const& details, bool isMockTest)
|
||||
void ExecuteTest(T& testObject, TestDetails const& details, bool isMockTest, bool templateIsTest)
|
||||
{
|
||||
if (isMockTest == false)
|
||||
CurrentTest::Details() = &details;
|
||||
|
||||
ParameterizedManager::getInstance().beginExecute(&details);
|
||||
if (templateIsTest)
|
||||
ParameterizedManager::getInstance().beginExecute(&details);
|
||||
|
||||
#ifdef UNITTEST_NO_EXCEPTIONS
|
||||
if (UNITTEST_SET_ASSERT_JUMP_TARGET() == 0)
|
||||
{
|
||||
|
|
@ -56,7 +59,8 @@ namespace UnitTest {
|
|||
#ifdef UNITTEST_NO_EXCEPTIONS
|
||||
}
|
||||
#endif
|
||||
ParameterizedManager::getInstance().finishExecute(&details);
|
||||
if (templateIsTest)
|
||||
ParameterizedManager::getInstance().finishExecute(&details);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace UnitTest {
|
|||
|
||||
void Test::Run()
|
||||
{
|
||||
ExecuteTest(*this, m_details, m_isMockTest);
|
||||
ExecuteTest(*this, m_details, m_isMockTest, true);
|
||||
}
|
||||
|
||||
void Test::RunImpl() const
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
({ \
|
||||
Fixture ## Name ## Helper fixtureHelper(m_details); \
|
||||
ctorOk = true; \
|
||||
UnitTest::ExecuteTest(fixtureHelper, m_details, false); \
|
||||
UnitTest::ExecuteTest(fixtureHelper, m_details, false, false); \
|
||||
}) \
|
||||
UT_CATCH (UnitTest::AssertException, e, \
|
||||
{ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue