Fixes some unit tests due to the removal of the MemoryDriller

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-02 12:41:32 -08:00
parent 19ddeeded9
commit de06bb75e5
4 changed files with 7 additions and 0 deletions
@@ -47,6 +47,7 @@ namespace UnitTest
void SetupAllocator(const AZ::SystemAllocator::Descriptor& allocatorDesc = {})
{
m_drillerManager = AZ::Debug::DrillerManager::Create();
AZ::AllocatorManager::Instance().EnterProfilingMode();
AZ::AllocatorManager::Instance().SetDefaultTrackingMode(AZ::Debug::AllocationRecords::RECORD_FULL);
// Only create the SystemAllocator if it s not ready
@@ -69,6 +70,7 @@ namespace UnitTest
AZ::Debug::DrillerManager::Destroy(m_drillerManager);
AZ::AllocatorManager::Instance().SetDefaultTrackingMode(AZ::Debug::AllocationRecords::RECORD_NO_RECORDS);
AZ::AllocatorManager::Instance().ExitProfilingMode();
}
};
+2
View File
@@ -44,10 +44,12 @@ namespace UnitTest
{
AZ::AllocatorManager::Instance().SetDefaultTrackingMode(AZ::Debug::AllocationRecords::RECORD_FULL);
m_drillerManager = Debug::DrillerManager::Create();
AZ::AllocatorManager::Instance().EnterProfilingMode();
}
void TearDown() override
{
Debug::DrillerManager::Destroy(m_drillerManager);
AZ::AllocatorManager::Instance().ExitProfilingMode();
AZ::AllocatorManager::Instance().SetDefaultTrackingMode(AZ::Debug::AllocationRecords::RECORD_NO_RECORDS);
}
protected:
@@ -271,6 +271,7 @@ namespace UnitTest
void SetUp() override
{
m_drillerManager = AZ::Debug::DrillerManager::Create();
AZ::AllocatorManager::Instance().EnterProfilingMode();
AZ::AllocatorManager::Instance().SetDefaultTrackingMode(AZ::Debug::AllocationRecords::RECORD_FULL);
if (azrtti_typeid<AllocatorType>() != azrtti_typeid<AZ::SystemAllocator>()) // simplifies instead of template specialization
@@ -292,6 +293,7 @@ namespace UnitTest
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
}
AZ::Debug::DrillerManager::Destroy(m_drillerManager);
AZ::AllocatorManager::Instance().ExitProfilingMode();
m_busRedirector.BusDisconnect();
EXPECT_EQ(m_leakExpected, m_leakDetected);
+1
View File
@@ -89,6 +89,7 @@ namespace UnitTest
if (m_drillerManager)
{
AZ::Debug::DrillerManager::Destroy(m_drillerManager);
AZ::AllocatorManager::Instance().ExitProfilingMode();
m_drillerManager = nullptr;
}
}