VideoPlaybackFrameworkTest.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <AzTest/AzTest.h>
  9. #include <AzCore/UnitTest/TestTypes.h>
  10. #include <AzCore/Component/ComponentApplication.h>
  11. #include <AzCore/Component/Entity.h>
  12. #include <AzCore/UserSettings/UserSettingsComponent.h>
  13. #include <VideoPlaybackFrameworkModule.h>
  14. #include <VideoPlaybackFrameworkSystemComponent.h>
  15. using VideoPlaybackFrameworkTest = UnitTest::LeakDetectionFixture;
  16. TEST_F(VideoPlaybackFrameworkTest, ComponentsWithComponentApplication)
  17. {
  18. AZ::ComponentApplication::Descriptor appDesc;
  19. appDesc.m_memoryBlocksByteSize = 10 * 1024 * 1024;
  20. appDesc.m_recordingMode = AZ::Debug::AllocationRecords::Mode::RECORD_FULL;
  21. AZ::ComponentApplication app;
  22. AZ::ComponentApplication::StartupParameters startupParameters;
  23. startupParameters.m_loadSettingsRegistry = false;
  24. AZ::Entity* systemEntity = app.Create(appDesc, startupParameters);
  25. ASSERT_TRUE(systemEntity != nullptr);
  26. app.RegisterComponentDescriptor(VideoPlaybackFramework::VideoPlaybackFrameworkSystemComponent::CreateDescriptor());
  27. systemEntity->CreateComponent<VideoPlaybackFramework::VideoPlaybackFrameworkSystemComponent>();
  28. systemEntity->Init();
  29. systemEntity->Activate();
  30. app.Destroy();
  31. ASSERT_TRUE(true);
  32. }
  33. AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);