diff --git a/test/entt/resource/resource_cache.cpp b/test/entt/resource/resource_cache.cpp index 8393ada21..80afc58fb 100644 --- a/test/entt/resource/resource_cache.cpp +++ b/test/entt/resource/resource_cache.cpp @@ -9,12 +9,10 @@ #include #include #include +#include "../../common/empty.h" #include "../../common/linter.hpp" #include "../../common/throwing_allocator.hpp" -struct broken_tag {}; -struct with_callback {}; - template struct loader { using result_type = std::shared_ptr; @@ -25,12 +23,12 @@ struct loader { } template - result_type operator()(with_callback, Func &&func) const { + result_type operator()(test::other_empty, Func &&func) const { return std::forward(func)(); } template - result_type operator()(broken_tag) const { + result_type operator()(test::empty) const { return {}; } }; @@ -393,7 +391,7 @@ TEST(ResourceCache, LoaderDispatching) { ASSERT_TRUE(cache.contains("resource"_hs)); ASSERT_EQ(cache["resource"_hs], 1); - cache.force_load("resource"_hs, with_callback{}, []() { return std::make_shared(2); }); + cache.force_load("resource"_hs, test::other_empty{}, []() { return std::make_shared(2); }); ASSERT_TRUE(cache.contains("resource"_hs)); ASSERT_EQ(cache["resource"_hs], 2); @@ -403,7 +401,7 @@ TEST(ResourceCache, BrokenLoader) { using namespace entt::literals; entt::resource_cache> cache; - cache.load("resource"_hs, broken_tag{}); + cache.load("resource"_hs, test::empty{}); ASSERT_TRUE(cache.contains("resource"_hs)); ASSERT_FALSE(cache["resource"_hs]);