浏览代码

test: clear context on exit for meta_factory tests

Michele Caini 1 年之前
父节点
当前提交
f0aff23469
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      test/entt/meta/meta_factory.cpp

+ 9 - 1
test/entt/meta/meta_factory.cpp

@@ -5,7 +5,15 @@
 #include <entt/meta/meta.hpp>
 #include <entt/meta/resolve.hpp>
 
-TEST(MetaFactory, Constructors) {
+struct MetaFactory: ::testing::Test {
+    void TearDown() override {
+        entt::meta_reset();
+    }
+};
+
+using MetaFactoryDeathTest = MetaFactory;
+
+TEST_F(MetaFactory, Constructors) {
     entt::meta_ctx ctx{};
 
     ASSERT_EQ(entt::resolve(entt::type_id<int>()), entt::meta_type{});