Missing fix for testing windows w/o RTTI (#2969)
* Enable no-rtti * Apply suggestions from code review Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * pass target * rename * rename * fix for installed header * update * compile with tests * add unit test for CI * rename for each package * wording updates * renames * rename * update name * fix for testing context pre-condition Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
This commit is contained in:
parent
5d4024f683
commit
8f3263a7ec
@ -449,12 +449,15 @@ TEST(Context, PreCondition)
|
||||
auto c2 = context.WithValue(key, s);
|
||||
int value;
|
||||
|
||||
// Type-safe assert requires RTTI build
|
||||
#if defined(AZ_CORE_RTTI)
|
||||
#if defined(NDEBUG)
|
||||
// Release build won't provide assert msg
|
||||
ASSERT_DEATH(c2.TryGetValue<int>(key, value), "");
|
||||
#else
|
||||
ASSERT_DEATH(c2.TryGetValue<int>(key, value), "Type mismatch for Context::TryGetValue");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(Context, KeyTypePairPrecondition)
|
||||
@ -475,12 +478,15 @@ TEST(Context, KeyTypePairPrecondition)
|
||||
EXPECT_FALSE(c2.TryGetValue<std::string>(keyNotFound, strValue));
|
||||
EXPECT_FALSE(c2.TryGetValue<int>(keyNotFound, intValue));
|
||||
|
||||
// Type-safe assert requires RTTI build
|
||||
#if defined(AZ_CORE_RTTI)
|
||||
#if defined(NDEBUG)
|
||||
// Release build won't provide assert msg
|
||||
ASSERT_DEATH(c2.TryGetValue<std::string>(key, strValue), "");
|
||||
#else
|
||||
ASSERT_DEATH(
|
||||
c2.TryGetValue<std::string>(key, strValue), "Type mismatch for Context::TryGetValue");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
EXPECT_TRUE(strValue == "previous value");
|
||||
@ -488,11 +494,14 @@ TEST(Context, KeyTypePairPrecondition)
|
||||
EXPECT_TRUE(c2.TryGetValue<int>(key, intValue));
|
||||
EXPECT_TRUE(intValue == 123);
|
||||
|
||||
// Type-safe assert requires RTTI build
|
||||
#if defined(AZ_CORE_RTTI)
|
||||
#if defined(NDEBUG)
|
||||
// Release build won't provide assert msg
|
||||
ASSERT_DEATH(c3.TryGetValue<int>(key, intValue), "");
|
||||
#else
|
||||
ASSERT_DEATH(c3.TryGetValue<int>(key, intValue), "Type mismatch for Context::TryGetValue");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
EXPECT_TRUE(intValue == 123);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user