Merge branch 'development' into LYN-4195

This commit is contained in:
John Jones-Steele
2021-06-15 09:16:26 +01:00
32 changed files with 39048 additions and 25318 deletions
+2 -2
View File
@@ -1154,13 +1154,13 @@ struct DiskOperationInfo
return *this;
}
DiskOperationInfo& operator - (const DiskOperationInfo& rv)
DiskOperationInfo operator - (const DiskOperationInfo& rv)
{
DiskOperationInfo res(*this);
return res -= rv;
}
DiskOperationInfo& operator + (const DiskOperationInfo& rv)
DiskOperationInfo operator + (const DiskOperationInfo& rv)
{
DiskOperationInfo res(*this);
return res += rv;
@@ -274,7 +274,7 @@ namespace AZ
{
using Callable = AZStd::conditional_t<AZStd::function_traits<Invocable>::value, AZStd::function<typename AZStd::function_traits<Invocable>::function_type>, Invocable>;
public:
AZ_RTTI((AttributeInvocable<Invocable>, "{60D5804F-9AF4-4EB1-8F5A-62AFB4883F9D}"), AZ::Attribute);
AZ_RTTI((AttributeInvocable<Invocable>, "{60D5804F-9AF4-4EB1-8F5A-62AFB4883F9D}", Invocable), AZ::Attribute);
AZ_CLASS_ALLOCATOR(AttributeInvocable<Invocable>, SystemAllocator, 0);
template<typename CallableType>
explicit AttributeInvocable(CallableType&& invocable)
@@ -2010,6 +2010,28 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
}
/*
This test will dynamic cast (azrtti_cast) between incompatible types, which should always result in nullptr.
If this test fails, the RTTI declaration for the relevant type is incorrect.
*/
TEST_F(Serialization, AttributeRTTI)
{
{
AttributeInvocable<AZStd::function<AZStd::string(AZStd::string)>> fn([](AZStd::string x) { return x + x; });
Attribute* fnDownCast = &fn;
auto fnUpCast = azrtti_cast<AttributeInvocable<AZStd::function<int(int)>>*>(fnDownCast);
EXPECT_EQ(fnUpCast, nullptr);
}
{
AttributeFunction<AZStd::string(AZStd::string)> fn([](AZStd::string x) { return x + x; });
Attribute* fnDownCast = &fn;
auto fnUpCast = azrtti_cast<AttributeFunction<int(int)>*>(fnDownCast);
EXPECT_EQ(fnUpCast, nullptr);
}
}
/*
* Deprecation
*/