Fixed unit tests when Spawnable system component was missing

This commit is contained in:
pereslav
2021-05-05 14:19:23 +01:00
parent 30625cf5d3
commit 9e2975ba3c
@@ -14,6 +14,7 @@
#include <AzCore/UnitTest/UnitTest.h>
#include <AzCore/Name/NameDictionary.h>
#include <AzCore/Name/Name.h>
#include <AzFramework/Spawnable/SpawnableSystemComponent.h>
#include <AzTest/AzTest.h>
#include <MultiplayerSystemComponent.h>
#include <IMultiplayerConnectionMock.h>
@@ -28,6 +29,7 @@ namespace UnitTest
{
SetupAllocator();
AZ::NameDictionary::Create();
m_spawnableComponent = new AzFramework::SpawnableSystemComponent();
m_mpComponent = new Multiplayer::MultiplayerSystemComponent();
m_initHandler = Multiplayer::SessionInitEvent::Handler([this](AzNetworking::INetworkInterface* value) { TestInitEvent(value); });
@@ -41,6 +43,7 @@ namespace UnitTest
void TearDown() override
{
delete m_mpComponent;
delete m_spawnableComponent;
AZ::NameDictionary::Destroy();
TeardownAllocator();
}
@@ -69,6 +72,7 @@ namespace UnitTest
Multiplayer::ConnectionAcquiredEvent::Handler m_connAcquiredHandler;
Multiplayer::MultiplayerSystemComponent* m_mpComponent = nullptr;
AzFramework::SpawnableSystemComponent* m_spawnableComponent = nullptr;
};
TEST_F(MultiplayerSystemTests, TestInitEvent)