Make InputDeviceId's constructor constexpr. (#5433)

* Make InputDeviceId's constructor constexpr.

See also https://github.com/o3de/o3de/pull/4220

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Updates based on review feedback.

Signed-off-by: bosnichd <bosnichd@amazon.com>
This commit is contained in:
bosnichd
2021-11-10 08:06:27 -07:00
committed by GitHub
parent 354802d387
commit eb775a48dc
17 changed files with 107 additions and 184 deletions
@@ -48,6 +48,24 @@ namespace InputUnitTests
AZStd::unique_ptr<InputSystemComponent> m_inputSystemComponent;
};
////////////////////////////////////////////////////////////////////////////////////////////////
TEST_F(InputTest, InputChannelId_ConstExpression_CopyConstructorSuccessfull)
{
constexpr InputChannelId testInputChannelId1("TestInputChannelId");
constexpr InputChannelId testInputChannelId2(testInputChannelId1);
static_assert(testInputChannelId1 == testInputChannelId2);
EXPECT_EQ(testInputChannelId1, testInputChannelId2);
}
////////////////////////////////////////////////////////////////////////////////////////////////
TEST_F(InputTest, InputDeviceId_ConstExpression_CopyConstructorSuccessfull)
{
constexpr InputDeviceId testInputDeviceId1("TestInputDeviceId");
constexpr InputDeviceId testInputDeviceId2(testInputDeviceId1);
static_assert(testInputDeviceId1 == testInputDeviceId2);
EXPECT_EQ(testInputDeviceId1, testInputDeviceId2);
}
////////////////////////////////////////////////////////////////////////////////////////////////
TEST_F(InputTest, InputContext_InitWithDataStruct_InitializationSuccessfull)
{