test: code coverage

This commit is contained in:
Michele Caini
2021-08-20 00:32:02 +02:00
parent fc5a529df8
commit a9ae9ce758
2 changed files with 12 additions and 0 deletions

View File

@@ -168,6 +168,7 @@ SETUP_BASIC_TEST(enum entt/core/enum.cpp)
SETUP_BASIC_TEST(family entt/core/family.cpp)
SETUP_BASIC_TEST(hashed_string entt/core/hashed_string.cpp)
SETUP_BASIC_TEST(ident entt/core/ident.cpp)
SETUP_BASIC_TEST(memory entt/core/memory.cpp)
SETUP_BASIC_TEST(monostate entt/core/monostate.cpp)
SETUP_BASIC_TEST(type_info entt/core/type_info.cpp)
SETUP_BASIC_TEST(type_traits entt/core/type_traits.cpp)

11
test/entt/core/memory.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include <memory>
#include <gtest/gtest.h>
#include <entt/core/memory.hpp>
TEST(Memory, Unfancy) {
std::shared_ptr<int> shared = std::make_shared<int>();
auto *plain = std::addressof(*shared);
ASSERT_EQ(entt::unfancy(shared), plain);
ASSERT_EQ(entt::unfancy(plain), plain);
}