فهرست منبع

test: non-regression tests for any mode into meta

skypjack 20 ساعت پیش
والد
کامیت
7694d8c24c
1فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 7 5
      test/entt/meta/meta_any.cpp

+ 7 - 5
test/entt/meta/meta_any.cpp

@@ -134,17 +134,19 @@ TEST_F(MetaAny, Empty) {
 TEST_F(MetaAny, EmptyAsRef) {
 TEST_F(MetaAny, EmptyAsRef) {
     entt::meta_any any{};
     entt::meta_any any{};
 
 
-    ASSERT_FALSE(any);
-    ASSERT_FALSE(any.type());
-    ASSERT_EQ(any.base().data(), nullptr);
-    ASSERT_EQ(any, entt::meta_any{});
-
     auto other = any.as_ref();
     auto other = any.as_ref();
 
 
     ASSERT_FALSE(other);
     ASSERT_FALSE(other);
     ASSERT_FALSE(other.type());
     ASSERT_FALSE(other.type());
     ASSERT_EQ(other.base().data(), nullptr);
     ASSERT_EQ(other.base().data(), nullptr);
     ASSERT_EQ(other, entt::meta_any{});
     ASSERT_EQ(other, entt::meta_any{});
+
+    other = std::as_const(any).as_ref();
+
+    ASSERT_FALSE(other);
+    ASSERT_FALSE(other.type());
+    ASSERT_EQ(other.base().data(), nullptr);
+    ASSERT_EQ(other, entt::meta_any{});
 }
 }
 
 
 TEST_F(MetaAny, Context) {
 TEST_F(MetaAny, Context) {