diff --git a/sdk/core/azure-core/test/ut/context_test.cpp b/sdk/core/azure-core/test/ut/context_test.cpp index 2d636a720..b48c4279c 100644 --- a/sdk/core/azure-core/test/ut/context_test.cpp +++ b/sdk/core/azure-core/test/ut/context_test.cpp @@ -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(key, value), ""); #else ASSERT_DEATH(c2.TryGetValue(key, value), "Type mismatch for Context::TryGetValue"); #endif +#endif } TEST(Context, KeyTypePairPrecondition) @@ -475,12 +478,15 @@ TEST(Context, KeyTypePairPrecondition) EXPECT_FALSE(c2.TryGetValue(keyNotFound, strValue)); EXPECT_FALSE(c2.TryGetValue(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(key, strValue), ""); #else ASSERT_DEATH( c2.TryGetValue(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(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(key, intValue), ""); #else ASSERT_DEATH(c3.TryGetValue(key, intValue), "Type mismatch for Context::TryGetValue"); +#endif #endif EXPECT_TRUE(intValue == 123);