Unregister custom SettingsRegistries in the test Teardown

This commit is contained in:
amzn-sj
2021-05-24 15:06:04 -07:00
parent 89cde021b2
commit 1a360094d2
4 changed files with 25 additions and 2 deletions
@@ -49,7 +49,7 @@ void PlatformConfigurationUnitTests::SetUp()
+ "/project_path";
registry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry);
using namespace AssetProcessor;
m_qApp = new QCoreApplication(m_argc, m_argv);
AssetProcessorTest::SetUp();
@@ -61,6 +61,12 @@ void PlatformConfigurationUnitTests::TearDown()
AssetUtilities::ResetAssetRoot();
delete m_qApp;
AssetProcessor::AssetProcessorTest::TearDown();
auto settingsRegistry = AZ::SettingsRegistry::Get();
if(settingsRegistry == &m_registry)
{
AZ::SettingsRegistry::Unregister(settingsRegistry);
}
}
TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_BadPlatform)