test: avoid some ASSERT_DEATH that don't trigger in release mode
This commit is contained in:
@@ -697,7 +697,7 @@ TEST(Any, AsRef) {
|
||||
ASSERT_EQ(entt::any_cast<const int &>(any), 42);
|
||||
ASSERT_EQ(entt::any_cast<int &>(ref), 42);
|
||||
ASSERT_EQ(entt::any_cast<const int &>(ref), 42);
|
||||
ASSERT_DEATH(entt::any_cast<int &>(cref), ".*");
|
||||
ASSERT_EQ(entt::any_cast<int>(&cref), nullptr);
|
||||
ASSERT_EQ(entt::any_cast<const int &>(cref), 42);
|
||||
|
||||
entt::any_cast<int &>(any) = 3;
|
||||
@@ -719,8 +719,8 @@ TEST(Any, AsRef) {
|
||||
ASSERT_EQ(entt::any_cast<const int>(&ref), any.data());
|
||||
ASSERT_EQ(entt::any_cast<const int>(&cref), any.data());
|
||||
|
||||
ASSERT_DEATH(entt::any_cast<int &>(ref), ".*");
|
||||
ASSERT_DEATH(entt::any_cast<int &>(cref), ".*");
|
||||
ASSERT_EQ(entt::any_cast<int>(&ref), nullptr);
|
||||
ASSERT_EQ(entt::any_cast<int>(&cref), nullptr);
|
||||
|
||||
ASSERT_EQ(entt::any_cast<const int &>(ref), 3);
|
||||
ASSERT_EQ(entt::any_cast<const int &>(cref), 3);
|
||||
|
||||
@@ -164,9 +164,9 @@ TEST(MetaPointerLike, PointerToConstMoveOnlyType) {
|
||||
ASSERT_TRUE(any);
|
||||
ASSERT_TRUE(deref);
|
||||
|
||||
ASSERT_DEATH(deref.cast<not_copyable_t &>() = {}, ".*");
|
||||
ASSERT_EQ(deref.try_cast<not_copyable_t>(), nullptr);
|
||||
ASSERT_NE(deref.try_cast<const not_copyable_t>(), nullptr);
|
||||
ASSERT_EQ(&deref.cast<const not_copyable_t &>(), &instance);
|
||||
}
|
||||
|
||||
TEST(MetaPointerLike, AsRef) {
|
||||
|
||||
Reference in New Issue
Block a user