3
0

AssetManagerTestFixture.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "AssetManagerTestFixture.h"
  9. #include <AzCore/Interface/Interface.h>
  10. #include <AzCore/Asset/AssetManager.h>
  11. #include <AzCore/Memory/PoolAllocator.h>
  12. namespace UnitTest
  13. {
  14. void AssetManagerTestFixture::SetUp()
  15. {
  16. using namespace AZ::Data;
  17. LeakDetectionFixture::SetUp();
  18. AssetManager::Descriptor desc;
  19. AssetManager::Create(desc);
  20. m_reflectionManager = AZStd::make_unique<AZ::ReflectionManager>();
  21. m_reflectionManager->AddReflectContext<AZ::SerializeContext>();
  22. AZ::ComponentApplicationBus::Handler::BusConnect();
  23. AZ::Interface<AZ::ComponentApplicationRequests>::Register(this);
  24. }
  25. void AssetManagerTestFixture::TearDown()
  26. {
  27. AZ::Interface<AZ::ComponentApplicationRequests>::Unregister(this);
  28. AZ::ComponentApplicationBus::Handler::BusDisconnect();
  29. using namespace AZ::Data;
  30. AZ::Data::AssetManager::Destroy();
  31. m_reflectionManager->Clear();
  32. m_reflectionManager.reset();
  33. LeakDetectionFixture::TearDown();
  34. }
  35. }