Fix EMotionFX Editor tests to compile with -Wshorten-64-to-32

Signed-off-by: Chris Burel <burelc@amazon.com>
This commit is contained in:
Chris Burel
2021-06-25 17:48:11 -07:00
parent 0547a1085a
commit 5602507024
12 changed files with 30 additions and 30 deletions
@@ -151,8 +151,8 @@ namespace EMotionFX
Skeleton* skeleton = actor->GetSkeleton();
EMotionFX::Mesh* mesh = nullptr;
const uint32 numNodes = skeleton->GetNumNodes();
for (uint32 nodeNum = 0; nodeNum < numNodes; ++nodeNum)
const size_t numNodes = skeleton->GetNumNodes();
for (size_t nodeNum = 0; nodeNum < numNodes; ++nodeNum)
{
if (mesh)
{
@@ -223,8 +223,8 @@ namespace EMotionFX
return;
}
const uint32 numMorphTargets = morphSetup->GetNumMorphTargets();
for (uint32 morphTargetIndex = 0; morphTargetIndex < numMorphTargets; ++morphTargetIndex)
const size_t numMorphTargets = morphSetup->GetNumMorphTargets();
for (size_t morphTargetIndex = 0; morphTargetIndex < numMorphTargets; ++morphTargetIndex)
{
const MorphTarget* morphTarget = morphSetup->GetMorphTarget(morphTargetIndex);
EXPECT_STREQ(morphTarget->GetName(), selectedMorphTargets[morphTargetIndex].c_str()) << "Morph target's name is incorrect";
@@ -75,7 +75,7 @@ namespace EMotionFX
ASSERT_TRUE(activeAnimGraph) << "An anim graph was not created with command: " << createAnimGraphCommand.c_str();
// Create a new AnimGraph Node
const AZ::u32 nodeCount = activeAnimGraph->GetNumNodes();
const size_t nodeCount = activeAnimGraph->GetNumNodes();
EXPECT_TRUE(CommandSystem::GetCommandManager()->ExecuteCommand(createNodeCommand, result)) << result.c_str();
EXPECT_EQ(activeAnimGraph->GetNumNodes(), nodeCount + 1) << "Expected one more anim graph node after running command: " << createNodeCommand.c_str();
}
@@ -82,7 +82,7 @@ namespace EMotionFX
const AnimGraph* targetAnimGraph = (animGraph ? animGraph : m_animGraphPlugin->GetActiveAnimGraph()); //AnimGraph to add Node to
const AZStd::string cmd = "AnimGraphCreateNode AnimGraphID " + AZStd::to_string(targetAnimGraph->GetID()) + " -type " + type + " " + args;
AZ::u32 nodeCount = targetAnimGraph->GetNumNodes(); //node count before creating a new node
size_t nodeCount = targetAnimGraph->GetNumNodes(); //node count before creating a new node
AZStd::string result;
EXPECT_TRUE(CommandSystem::GetCommandManager()->ExecuteCommand(cmd, result)) << result.c_str();
@@ -112,7 +112,7 @@ namespace EMotionFX
const EMotionFX::AnimGraphNode* currentNode = GetActiveNodeGraph()->GetModelIndex().data(EMStudio::AnimGraphModel::ROLE_NODE_POINTER).value<EMotionFX::AnimGraphNode*>();
const int numNodesAfter = currentNode->GetNumChildNodes();
const size_t numNodesAfter = currentNode->GetNumChildNodes();
if (numNodesAfter == 0)
{
return nullptr;
@@ -49,7 +49,7 @@ namespace EMotionFX
ASSERT_TRUE(motionSetWindow) << "No motion set window found";
// Check there aren't any motion sets yet.
const AZ::u32 numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
EXPECT_EQ(numMotionSets, 0);
// Find the action to create a new motion set and press it.
@@ -58,7 +58,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionSetButton, Qt::LeftButton);
// Make sure the new motion set has been created.
const AZ::u32 numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
ASSERT_EQ(numMotionSetsAfterCreate, numMotionSets + 1) << "Failed to create motion set.";
EMotionFX::MotionSet* motionSet = EMotionFX::GetMotionManager().GetMotionSet(0);
@@ -38,7 +38,7 @@ namespace EMotionFX
ASSERT_TRUE(motionSetWindow) << "No motion set window found";
// Check there aren't any motion sets yet.
uint32 numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
size_t numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
EXPECT_EQ(numMotionSets, 0);
// Find the action to create a new motion set and press it.
@@ -47,7 +47,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionSetButton, Qt::LeftButton);
// Check there is now a motion set.
int numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
size_t numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
ASSERT_EQ(numMotionSetsAfterCreate, 1);
EMotionFX::MotionSet* motionSet = EMotionFX::GetMotionManager().GetMotionSet(0);
@@ -56,7 +56,7 @@ namespace EMotionFX
motionSetPlugin->SetSelectedSet(motionSet);
// It should be empty at the moment.
int numMotions = static_cast<int>(motionSet->GetNumMotionEntries());
size_t numMotions = motionSet->GetNumMotionEntries();
EXPECT_EQ(numMotions, 0);
// Find the action to add a motion to the set and press it.
@@ -65,7 +65,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionButton, Qt::LeftButton);
// There should now be a motion.
int numMotionsAfterCreate = static_cast<int>(motionSet->GetNumMotionEntries());
size_t numMotionsAfterCreate = motionSet->GetNumMotionEntries();
ASSERT_EQ(numMotionsAfterCreate, 1);
AZStd::unordered_map<AZStd::string, MotionSet::MotionEntry*> motions = motionSet->GetMotionEntries();
@@ -47,7 +47,7 @@ namespace EMotionFX
addReferenceNodeAction->trigger();
// Check the expected node now exists.
int numNodesAfter= currentNode->GetNumChildNodes();
size_t numNodesAfter = currentNode->GetNumChildNodes();
EXPECT_EQ(1, numNodesAfter);
AnimGraphNode* newNode = currentNode->GetChildNode(0);
@@ -74,7 +74,7 @@ namespace EMotionFX
QTest::mouseClick(createButton, Qt::LeftButton);
// Check we only have the one Parameter
int numParameters = static_cast<int>(newGraph->GetNumParameters());
size_t numParameters = newGraph->GetNumParameters();
EXPECT_EQ(numParameters, 1) << "Not just 1 parameter";
const RangedValueParameter<float, FloatParameter>* parameter = reinterpret_cast<const RangedValueParameter<float, FloatParameter>* >(newGraph->FindValueParameter(0));
@@ -99,7 +99,7 @@ namespace EMotionFX
// InitAfterLoading() is called
morphTargetNode->AddConnection(
parameterNode,
parameterNode->FindOutputPortIndex("FloatParam"),
aznumeric_caster(parameterNode->FindOutputPortIndex("FloatParam")),
BlendTreeMorphTargetNode::PORTID_INPUT_WEIGHT
);
finalNode->AddConnection(
@@ -41,7 +41,7 @@ namespace EMotionFX
ASSERT_TRUE(motionSetWindow) << "No motion set window found";
// Check there aren't any motion sets yet.
const uint32 numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
EXPECT_EQ(numMotionSets, 0);
// Find the action to create a new motion set and press it.
@@ -50,7 +50,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionSetButton, Qt::LeftButton);
// Check there is now a motion set.
const int numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
ASSERT_EQ(numMotionSetsAfterCreate, 1);
EMotionFX::MotionSet* motionSet = EMotionFX::GetMotionManager().GetMotionSet(0);
@@ -59,7 +59,7 @@ namespace EMotionFX
motionSetPlugin->SetSelectedSet(motionSet);
// It should be empty at the moment.
const int numMotions = static_cast<int>(motionSet->GetNumMotionEntries());
const size_t numMotions = motionSet->GetNumMotionEntries();
EXPECT_EQ(numMotions, 0);
// Find the action to add a motion to the set and press it.
@@ -68,7 +68,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionButton, Qt::LeftButton);
// There should now be a motion.
const int numMotionsAfterCreate = static_cast<int>(motionSet->GetNumMotionEntries());
const size_t numMotionsAfterCreate = motionSet->GetNumMotionEntries();
ASSERT_EQ(numMotionsAfterCreate, 1);
AZStd::unordered_map<AZStd::string, MotionSet::MotionEntry*> motions = motionSet->GetMotionEntries();
@@ -122,7 +122,7 @@ namespace EMotionFX
ASSERT_TRUE(motionSetWindow) << "No motion set window found";
// Check there aren't any motion sets yet.
const uint32 numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSets = EMotionFX::GetMotionManager().GetNumMotionSets();
EXPECT_EQ(numMotionSets, 0);
// Find the action to create a new motion set and press it.
@@ -131,7 +131,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionSetButton, Qt::LeftButton);
// Check there is now a motion set.
const int numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
const size_t numMotionSetsAfterCreate = EMotionFX::GetMotionManager().GetNumMotionSets();
ASSERT_EQ(numMotionSetsAfterCreate, 1);
EMotionFX::MotionSet* motionSet = EMotionFX::GetMotionManager().GetMotionSet(0);
@@ -140,7 +140,7 @@ namespace EMotionFX
motionSetPlugin->SetSelectedSet(motionSet);
// It should be empty at the moment.
const int numMotions = static_cast<int>(motionSet->GetNumMotionEntries());
const size_t numMotions = motionSet->GetNumMotionEntries();
EXPECT_EQ(numMotions, 0);
// Find the action to add a motion to the set and press it twice.
@@ -150,7 +150,7 @@ namespace EMotionFX
QTest::mouseClick(addMotionButton, Qt::LeftButton);
// There should now be two motion.
const int numMotionsAfterCreate = static_cast<int>(motionSet->GetNumMotionEntries());
const size_t numMotionsAfterCreate = motionSet->GetNumMotionEntries();
ASSERT_EQ(numMotionsAfterCreate, 2);
AZStd::unordered_map<AZStd::string, MotionSet::MotionEntry*> motions = motionSet->GetMotionEntries();
@@ -41,7 +41,7 @@ namespace EMotionFX
CommandSystem::CreateAnimGraphNode(/*commandGroup=*/nullptr, animGraph, azrtti_typeid<EMotionFX::AnimGraphReferenceNode>(), "Reference", currentNode, 0, 0);
// Check the expected node now exists.
uint32 numNodes = currentNode->GetNumChildNodes();
size_t numNodes = currentNode->GetNumChildNodes();
EXPECT_EQ(1, numNodes);
// Undo.
@@ -49,7 +49,7 @@ namespace EMotionFX
ASSERT_TRUE(undoAction);
undoAction->trigger();
const uint32 numNodesAfterUndo = currentNode->GetNumChildNodes();
const size_t numNodesAfterUndo = currentNode->GetNumChildNodes();
ASSERT_EQ(numNodesAfterUndo, numNodes - 1);
// Redo.
@@ -57,7 +57,7 @@ namespace EMotionFX
ASSERT_TRUE(redoAction);
redoAction->trigger();
const uint32 numNodesAfterRedo = currentNode->GetNumChildNodes();
const size_t numNodesAfterRedo = currentNode->GetNumChildNodes();
ASSERT_EQ(numNodesAfterRedo, numNodesAfterUndo + 1);
}
} // namespace EMotionFX
@@ -106,7 +106,7 @@ namespace EMotionFX
QList<QAction*> actions = viewMenu->findChildren<QAction*>();
int numActions = actions.size() - 1;// -1 as we don't want to include the view menu action itself.
const AZ::u32 numPlugins = pluginManager->GetNumPlugins();
const size_t numPlugins = pluginManager->GetNumPlugins();
int visiblePlugins = 0;
+2 -2
View File
@@ -73,8 +73,8 @@ namespace EMotionFX
{
// Plugins have to be created after both the QApplication object and
// after the SystemComponent
const uint32 numPlugins = EMStudio::GetPluginManager()->GetNumPlugins();
for (uint32 i = 0; i < numPlugins; ++i)
const size_t numPlugins = EMStudio::GetPluginManager()->GetNumPlugins();
for (size_t i = 0; i < numPlugins; ++i)
{
EMStudio::EMStudioPlugin* plugin = EMStudio::GetPluginManager()->GetPlugin(i);
EMStudio::GetPluginManager()->CreateWindowOfType(plugin->GetName());