Merge remote-tracking branch 'upstream/development' into nvsickle/OutlinerDuplicateEntryFixes
This commit is contained in:
@@ -31,7 +31,6 @@ namespace UnitTest
|
||||
{
|
||||
namespace
|
||||
{
|
||||
|
||||
bool CreateDummyFile(const QString& fullPathToFile, const QString& tempStr = {})
|
||||
{
|
||||
QFileInfo fi(fullPathToFile);
|
||||
@@ -50,7 +49,7 @@ namespace UnitTest
|
||||
return true;
|
||||
}
|
||||
|
||||
class ArchiveTest :
|
||||
class ArchiveComponentTest :
|
||||
public ::testing::Test
|
||||
{
|
||||
|
||||
@@ -73,7 +72,12 @@ namespace UnitTest
|
||||
return "Archive";
|
||||
}
|
||||
|
||||
void CreateArchiveFolder( QString archiveFolderName, QStringList fileList )
|
||||
QString GetExtractFolderName()
|
||||
{
|
||||
return "Extracted";
|
||||
}
|
||||
|
||||
void CreateArchiveFolder(QString archiveFolderName, QStringList fileList)
|
||||
{
|
||||
QDir tempPath = QDir(m_tempDir.GetDirectory()).filePath(archiveFolderName);
|
||||
|
||||
@@ -84,6 +88,14 @@ namespace UnitTest
|
||||
}
|
||||
}
|
||||
|
||||
QString CreateArchiveListTextFile()
|
||||
{
|
||||
QString listFilePath = QDir(m_tempDir.GetDirectory()).absoluteFilePath("FileList.txt");
|
||||
QString textContent = CreateArchiveFileList().join("\n");
|
||||
EXPECT_TRUE(CreateDummyFile(listFilePath, textContent));
|
||||
return listFilePath;
|
||||
}
|
||||
|
||||
void CreateArchiveFolder()
|
||||
{
|
||||
CreateArchiveFolder(GetArchiveFolderName(), CreateArchiveFileList());
|
||||
@@ -99,16 +111,24 @@ namespace UnitTest
|
||||
return QDir(m_tempDir.GetDirectory()).filePath(GetArchiveFolderName());
|
||||
}
|
||||
|
||||
QString GetExtractFolder()
|
||||
{
|
||||
return QDir(m_tempDir.GetDirectory()).filePath(GetExtractFolderName());
|
||||
}
|
||||
|
||||
bool CreateArchive()
|
||||
{
|
||||
bool createResult{ false };
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(createResult, &AzToolsFramework::ArchiveCommandsBus::Events::CreateArchiveBlocking, GetArchivePath().toStdString().c_str(), GetArchiveFolder().toStdString().c_str());
|
||||
return createResult;
|
||||
std::future<bool> createResult;
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(createResult,
|
||||
&AzToolsFramework::ArchiveCommandsBus::Events::CreateArchive,
|
||||
GetArchivePath().toUtf8().constData(), GetArchiveFolder().toUtf8().constData());
|
||||
bool result = createResult.get();
|
||||
return result;
|
||||
}
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
m_app.reset(aznew ToolsTestApplication("ArchiveTest"));
|
||||
m_app.reset(aznew ToolsTestApplication("ArchiveComponentTest"));
|
||||
m_app->Start(AzFramework::Application::Descriptor());
|
||||
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
|
||||
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
|
||||
@@ -132,76 +152,138 @@ namespace UnitTest
|
||||
};
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveTest, DISABLED_CreateArchiveBlocking_FilesAtThreeDepths_ArchiveCreated)
|
||||
TEST_F(ArchiveComponentTest, DISABLED_CreateArchive_FilesAtThreeDepths_ArchiveCreated)
|
||||
#else
|
||||
TEST_F(ArchiveTest, CreateArchiveBlocking_FilesAtThreeDepths_ArchiveCreated)
|
||||
TEST_F(ArchiveComponentTest, CreateArchive_FilesAtThreeDepths_ArchiveCreated)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
EXPECT_TRUE(m_tempDir.IsValid());
|
||||
CreateArchiveFolder();
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
bool createResult = CreateArchive();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_EQ(createResult, true);
|
||||
EXPECT_TRUE(createResult);
|
||||
}
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveTest, DISABLED_ListFilesInArchiveBlocking_FilesAtThreeDepths_FilesFound)
|
||||
TEST_F(ArchiveComponentTest, DISABLED_ListFilesInArchive_FilesAtThreeDepths_FilesFound)
|
||||
#else
|
||||
TEST_F(ArchiveTest, ListFilesInArchiveBlocking_FilesAtThreeDepths_FilesFound)
|
||||
TEST_F(ArchiveComponentTest, ListFilesInArchive_FilesAtThreeDepths_FilesFound)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
EXPECT_TRUE(m_tempDir.IsValid());
|
||||
CreateArchiveFolder();
|
||||
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
EXPECT_EQ(CreateArchive(), true);
|
||||
|
||||
AZStd::vector<AZStd::string> fileList;
|
||||
bool listResult{ false };
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(listResult, &AzToolsFramework::ArchiveCommandsBus::Events::ListFilesInArchiveBlocking, GetArchivePath().toStdString().c_str(), fileList);
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(listResult,
|
||||
&AzToolsFramework::ArchiveCommandsBus::Events::ListFilesInArchive,
|
||||
GetArchivePath().toUtf8().constData(), fileList);
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_TRUE(listResult);
|
||||
EXPECT_EQ(fileList.size(), 6);
|
||||
}
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveTest, DISABLED_CreateDeltaCatalog_AssetsNotRegistered_Failure)
|
||||
TEST_F(ArchiveComponentTest, DISABLED_CreateDeltaCatalog_AssetsNotRegistered_Failure)
|
||||
#else
|
||||
TEST_F(ArchiveTest, CreateDeltaCatalog_AssetsNotRegistered_Failure)
|
||||
TEST_F(ArchiveComponentTest, CreateDeltaCatalog_AssetsNotRegistered_Failure)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
QStringList fileList = CreateArchiveFileList();
|
||||
|
||||
CreateArchiveFolder(GetArchiveFolderName(), fileList);
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
bool createResult = CreateArchive();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_EQ(createResult, true);
|
||||
|
||||
bool catalogCreated{ true };
|
||||
AZ::Test::AssertAbsorber assertAbsorber;
|
||||
AzToolsFramework::AssetBundleCommandsBus::BroadcastResult(catalogCreated, &AzToolsFramework::AssetBundleCommandsBus::Events::CreateDeltaCatalog, GetArchivePath().toStdString().c_str(), true);
|
||||
AzToolsFramework::AssetBundleCommandsBus::BroadcastResult(catalogCreated,
|
||||
&AzToolsFramework::AssetBundleCommandsBus::Events::CreateDeltaCatalog, GetArchivePath().toUtf8().constData(), true);
|
||||
|
||||
EXPECT_EQ(catalogCreated, false);
|
||||
}
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveTest, DISABLED_CreateDeltaCatalog_ArchiveWithoutCatalogAssetsRegistered_Success)
|
||||
TEST_F(ArchiveComponentTest, DISABLED_AddFilesToArchive_FromListFile_Success)
|
||||
#else
|
||||
TEST_F(ArchiveTest, CreateDeltaCatalog_ArchiveWithoutCatalogAssetsRegistered_Success)
|
||||
TEST_F(ArchiveComponentTest, AddFilesToArchive_FromListFile_Success)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
QString listFile = CreateArchiveListTextFile();
|
||||
CreateArchiveFolder(GetArchiveFolderName(), CreateArchiveFileList());
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
std::future<bool> addResult;
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(
|
||||
addResult, &AzToolsFramework::ArchiveCommandsBus::Events::AddFilesToArchive, GetArchivePath().toUtf8().constData(),
|
||||
GetArchiveFolder().toUtf8().constData(), listFile.toUtf8().constData());
|
||||
bool result = addResult.get();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_TRUE(result);
|
||||
}
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveComponentTest, DISABLED_ExtractArchive_AllFiles_Success)
|
||||
#else
|
||||
TEST_F(ArchiveComponentTest, ExtractArchive_AllFiles_Success)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
CreateArchiveFolder();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
bool createResult = CreateArchive();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
EXPECT_TRUE(createResult);
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
std::future<bool> extractResult;
|
||||
AzToolsFramework::ArchiveCommandsBus::BroadcastResult(
|
||||
extractResult, &AzToolsFramework::ArchiveCommandsBus::Events::ExtractArchive, GetArchivePath().toUtf8().constData(),
|
||||
GetExtractFolder().toUtf8().constData());
|
||||
bool result = extractResult.get();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
QStringList archiveFiles = CreateArchiveFileList();
|
||||
for (const auto& file : archiveFiles)
|
||||
{
|
||||
QString fullFilePath = QDir(GetExtractFolder()).absoluteFilePath(file);
|
||||
QFileInfo fi(fullFilePath);
|
||||
EXPECT_TRUE(fi.exists());
|
||||
}
|
||||
}
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
TEST_F(ArchiveComponentTest, DISABLED_CreateDeltaCatalog_ArchiveWithoutCatalogAssetsRegistered_Success)
|
||||
#else
|
||||
TEST_F(ArchiveComponentTest, CreateDeltaCatalog_ArchiveWithoutCatalogAssetsRegistered_Success)
|
||||
#endif // AZ_TRAIT_DISABLE_FAILED_ARCHIVE_TESTS
|
||||
{
|
||||
QStringList fileList = CreateArchiveFileList();
|
||||
|
||||
CreateArchiveFolder(GetArchiveFolderName(), fileList);
|
||||
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
bool createResult = CreateArchive();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT;
|
||||
|
||||
EXPECT_EQ(createResult, true);
|
||||
|
||||
for (const auto& thisPath : fileList)
|
||||
{
|
||||
AZ::Data::AssetInfo newInfo;
|
||||
newInfo.m_relativePath = thisPath.toStdString().c_str();
|
||||
newInfo.m_relativePath = thisPath.toUtf8().constData();
|
||||
newInfo.m_assetType = AZ::Uuid::CreateRandom();
|
||||
newInfo.m_sizeBytes = 100; // Arbitrary
|
||||
AZ::Data::AssetId generatedID(AZ::Uuid::CreateRandom());
|
||||
@@ -212,7 +294,7 @@ namespace UnitTest
|
||||
|
||||
bool catalogCreated{ false };
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
AzToolsFramework::AssetBundleCommandsBus::BroadcastResult(catalogCreated, &AzToolsFramework::AssetBundleCommandsBus::Events::CreateDeltaCatalog, GetArchivePath().toStdString().c_str(), true);
|
||||
AzToolsFramework::AssetBundleCommandsBus::BroadcastResult(catalogCreated, &AzToolsFramework::AssetBundleCommandsBus::Events::CreateDeltaCatalog, GetArchivePath().toUtf8().constData(), true);
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; // produces different counts in different platforms
|
||||
EXPECT_EQ(catalogCreated, true);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Benchmark
|
||||
AZStd::unique_ptr<Instance> instance = m_prefabSystemComponent->CreatePrefab(
|
||||
entities
|
||||
, {}
|
||||
, m_pathString);
|
||||
, m_pathString);
|
||||
|
||||
state.PauseTiming();
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Benchmark
|
||||
{
|
||||
nestedInstanceRoot = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(nestedInstanceRoot) ),
|
||||
MakeInstanceList(AZStd::move(nestedInstanceRoot)),
|
||||
m_paths[instanceCounter]);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -36,7 +36,7 @@ namespace Benchmark
|
||||
|
||||
AZStd::unique_ptr<Instance> enclosingInstance = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(nestedInstance) ),
|
||||
MakeInstanceList(AZStd::move(nestedInstance)),
|
||||
enclosingTemplatePath);
|
||||
|
||||
TemplateId templateToInstantiateId = enclosingInstance->GetTemplateId();
|
||||
@@ -99,7 +99,7 @@ namespace Benchmark
|
||||
{
|
||||
currentInstanceRoot = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(currentInstanceRoot) ),
|
||||
MakeInstanceList(AZStd::move(currentInstanceRoot)),
|
||||
m_paths[currentDepth - 1]);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Benchmark
|
||||
{
|
||||
currentInstanceRoot = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(currentInstanceRoot) ),
|
||||
MakeInstanceList(AZStd::move(currentInstanceRoot)),
|
||||
m_paths[currentDepth]);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Benchmark
|
||||
|
||||
currentInstanceRoot = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(currentInstanceRoot), AZStd::move(extraNestedInstance) ),
|
||||
MakeInstanceList(AZStd::move(currentInstanceRoot), AZStd::move(extraNestedInstance)),
|
||||
m_paths[currentDepth]);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace UnitTest
|
||||
|
||||
// Create a street prefab that nests the car and sportscar instances created above. The container entity will be created as part of the process.
|
||||
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> streetInstance =
|
||||
m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList( AZStd::move(carInstance), AZStd::move(sportsCarInstance) ), "test/street");
|
||||
m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList(AZStd::move(carInstance), AZStd::move(sportsCarInstance)), "test/street");
|
||||
ASSERT_TRUE(streetInstance);
|
||||
m_instanceMap[StreetEntityName] = streetInstance.get();
|
||||
|
||||
|
||||
+1
-1
@@ -320,7 +320,7 @@ namespace UnitTest
|
||||
Instance& addedInstance = *addedInstancePtr;
|
||||
|
||||
//create a first instance where the instance will be removed
|
||||
AZStd::unique_ptr<Instance> firstInstance = m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList( AZStd::move(addedInstancePtr) ), "test/path");
|
||||
AZStd::unique_ptr<Instance> firstInstance = m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList(AZStd::move(addedInstancePtr)), "test/path");
|
||||
ASSERT_TRUE(firstInstance);
|
||||
|
||||
//get added instance alias
|
||||
|
||||
@@ -44,11 +44,11 @@ namespace UnitTest
|
||||
ASSERT_TRUE(firstInstance);
|
||||
|
||||
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> secondInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(firstInstance) ), "test/path2");
|
||||
MakeInstanceList(AZStd::move(firstInstance)), "test/path2");
|
||||
ASSERT_TRUE(secondInstance);
|
||||
|
||||
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> thirdInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(secondInstance) ), "test/path3");
|
||||
MakeInstanceList(AZStd::move(secondInstance)), "test/path3");
|
||||
ASSERT_TRUE(thirdInstance);
|
||||
|
||||
//Instantiate it
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace UnitTest
|
||||
using namespace AzToolsFramework::Prefab;
|
||||
LinkData CreateLinkData(
|
||||
const InstanceData& instanceData,
|
||||
const TemplateId& sourceTemplateId,
|
||||
const TemplateId& targetTemplateId)
|
||||
TemplateId sourceTemplateId,
|
||||
TemplateId targetTemplateId)
|
||||
{
|
||||
LinkData newLinkData;
|
||||
newLinkData.m_instanceData = instanceData;
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace UnitTest
|
||||
{
|
||||
LinkData CreateLinkData(
|
||||
const InstanceData& instanceData,
|
||||
const AzToolsFramework::Prefab::TemplateId& sourceTemplateId,
|
||||
const AzToolsFramework::Prefab::TemplateId& targetTemplateId);
|
||||
AzToolsFramework::Prefab::TemplateId sourceTemplateId,
|
||||
AzToolsFramework::Prefab::TemplateId targetTemplateId);
|
||||
|
||||
InstanceData CreateInstanceDataWithNoPatches(
|
||||
const AZStd::string& name,
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
void ValidateInstances(
|
||||
const TemplateId& templateId,
|
||||
TemplateId templateId,
|
||||
const PrefabDomValue& expectedContent,
|
||||
const PrefabDomPath& contentPath,
|
||||
bool isContentAnInstance,
|
||||
@@ -204,7 +204,7 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
void ValidateEntitiesOfInstances(
|
||||
const AzToolsFramework::Prefab::TemplateId& templateId,
|
||||
AzToolsFramework::Prefab::TemplateId templateId,
|
||||
const AzToolsFramework::Prefab::PrefabDom& expectedPrefabDom,
|
||||
const AZStd::vector<EntityAlias>& entityAliases)
|
||||
{
|
||||
@@ -219,7 +219,7 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
void ValidateNestedInstancesOfInstances(
|
||||
const AzToolsFramework::Prefab::TemplateId& templateId,
|
||||
AzToolsFramework::Prefab::TemplateId templateId,
|
||||
const AzToolsFramework::Prefab::PrefabDom& expectedPrefabDom,
|
||||
const AZStd::vector<InstanceAlias>& nestedInstanceAliases)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace UnitTest
|
||||
const PrefabDomValue& patches);
|
||||
|
||||
void ValidateInstances(
|
||||
const TemplateId& templateId,
|
||||
TemplateId templateId,
|
||||
const PrefabDomValue& expectedContent,
|
||||
const PrefabDomPath& contentPath,
|
||||
bool isContentAnInstance = false,
|
||||
@@ -147,12 +147,12 @@ namespace UnitTest
|
||||
void ComparePrefabDomValues(PrefabDomValueConstReference valueA, PrefabDomValueConstReference valueB);
|
||||
|
||||
void ValidateEntitiesOfInstances(
|
||||
const AzToolsFramework::Prefab::TemplateId& templateId,
|
||||
AzToolsFramework::Prefab::TemplateId templateId,
|
||||
const AzToolsFramework::Prefab::PrefabDom& expectedPrefabDom,
|
||||
const AZStd::vector<EntityAlias>& entityAliases);
|
||||
|
||||
void ValidateNestedInstancesOfInstances(
|
||||
const AzToolsFramework::Prefab::TemplateId& templateId,
|
||||
AzToolsFramework::Prefab::TemplateId templateId,
|
||||
const AzToolsFramework::Prefab::PrefabDom& expectedPrefabDom,
|
||||
const AZStd::vector<InstanceAlias>& nestedInstanceAliases);
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace UnitTest
|
||||
{
|
||||
//create two prefabs for test
|
||||
//create prefab 1
|
||||
firstInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({ }, {}, "test/path0"));
|
||||
firstInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({}, {}, "test/path0"));
|
||||
ASSERT_TRUE(firstInstance);
|
||||
|
||||
//get template id
|
||||
ownerId = firstInstance->GetTemplateId();
|
||||
|
||||
//create prefab 2
|
||||
secondInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({ }, {}, "test/path1"));
|
||||
secondInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({}, {}, "test/path1"));
|
||||
ASSERT_TRUE(secondInstance);
|
||||
|
||||
//get template id
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace UnitTest
|
||||
|
||||
// Create an enclosing Template with 0 entities and 1 nested Instance.
|
||||
AZStd::unique_ptr<Instance> nestedInstance1 = m_prefabSystemComponent->InstantiatePrefab(newNestedTemplateId);
|
||||
AZStd::unique_ptr<Instance> newEnclosingInstance = m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList( AZStd::move(nestedInstance1) ), PrefabMockFilePath);
|
||||
AZStd::unique_ptr<Instance> newEnclosingInstance = m_prefabSystemComponent->CreatePrefab({}, MakeInstanceList(AZStd::move(nestedInstance1)), PrefabMockFilePath);
|
||||
TemplateId newEnclosingTemplateId = newEnclosingInstance->GetTemplateId();
|
||||
EXPECT_TRUE(newEnclosingTemplateId != InvalidTemplateId);
|
||||
PrefabDom& newEnclosingTemplateDom = m_prefabSystemComponent->FindTemplateDom(newEnclosingTemplateId);
|
||||
@@ -284,7 +284,7 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<Instance> nestedInstance2 = m_prefabSystemComponent->InstantiatePrefab(newNestedTemplateId);
|
||||
AZStd::unique_ptr<Instance> newEnclosingInstance = m_prefabSystemComponent->CreatePrefab(
|
||||
{},
|
||||
MakeInstanceList( AZStd::move(nestedInstance1), AZStd::move(nestedInstance2) ),
|
||||
MakeInstanceList(AZStd::move(nestedInstance1), AZStd::move(nestedInstance2)),
|
||||
PrefabMockFilePath);
|
||||
TemplateId newEnclosingTemplateId = newEnclosingInstance->GetTemplateId();
|
||||
EXPECT_TRUE(newEnclosingTemplateId != InvalidTemplateId);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> wheel2UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle), AZStd::move(wheel2UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle), AZStd::move(wheel2UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
@@ -51,7 +51,7 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<Instance> axle2UnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> spareWheelUnderCar = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axle1UnderCar), AZStd::move(axle2UnderCar), AZStd::move(spareWheelUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axle1UnderCar), AZStd::move(axle2UnderCar), AZStd::move(spareWheelUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -93,7 +93,7 @@ namespace UnitTest
|
||||
// Create an axle with 0 entities and 1 wheel instance.
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -105,7 +105,7 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<Instance> axle1UnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> axle2UnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axle1UnderCar), AZStd::move(axle2UnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axle1UnderCar), AZStd::move(axle2UnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
@@ -151,7 +151,7 @@ namespace UnitTest
|
||||
// Create an axle with 0 entities and 1 wheel instance.
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -159,7 +159,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axleUnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axleUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axleUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
@@ -205,7 +205,7 @@ namespace UnitTest
|
||||
// Create an axle with 0 entities and 1 wheel instance.
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -213,7 +213,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axleUnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axleUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axleUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
@@ -253,7 +253,7 @@ namespace UnitTest
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> wheel2UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle), AZStd::move(wheel2UnderAxle) ),
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle), AZStd::move(wheel2UnderAxle) ),
|
||||
AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
@@ -265,7 +265,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axle1UnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axle1UnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axle1UnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
@@ -320,7 +320,7 @@ namespace UnitTest
|
||||
// Create an axle with 0 entities and 1 wheel instance.
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -328,7 +328,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axleUnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axleUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axleUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
@@ -381,7 +381,7 @@ namespace UnitTest
|
||||
// Create an axle with 0 entities and 1 wheel instance.
|
||||
AZStd::unique_ptr<Instance> wheel1UnderAxle = m_prefabSystemComponent->InstantiatePrefab(wheelTemplateId);
|
||||
AZStd::unique_ptr<Instance> axleInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(wheel1UnderAxle) ), AxlePrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(wheel1UnderAxle)), AxlePrefabMockFilePath);
|
||||
const TemplateId axleTemplateId = axleInstance->GetTemplateId();
|
||||
PrefabDom& axleTemplateDom = m_prefabSystemComponent->FindTemplateDom(axleTemplateId);
|
||||
const AZStd::vector<InstanceAlias> wheelInstanceAliasesUnderAxle = axleInstance->GetNestedInstanceAliases(wheelTemplateId);
|
||||
@@ -389,7 +389,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axleUnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axleUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axleUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace UnitTest
|
||||
// Create a car with 0 entities and 1 axle instance.
|
||||
AZStd::unique_ptr<Instance> axleUnderCar = m_prefabSystemComponent->InstantiatePrefab(axleTemplateId);
|
||||
AZStd::unique_ptr<Instance> carInstance = m_prefabSystemComponent->CreatePrefab({},
|
||||
MakeInstanceList( AZStd::move(axleUnderCar) ), CarPrefabMockFilePath);
|
||||
MakeInstanceList(AZStd::move(axleUnderCar)), CarPrefabMockFilePath);
|
||||
const TemplateId carTemplateId = carInstance->GetTemplateId();
|
||||
const AZStd::vector<InstanceAlias> axleInstanceAliasesUnderCar = carInstance->GetNestedInstanceAliases(axleTemplateId);
|
||||
PrefabDom& carTemplateDom = m_prefabSystemComponent->FindTemplateDom(carTemplateId);
|
||||
|
||||
Reference in New Issue
Block a user