test: bare minimum tests for meta types from different contexts
This commit is contained in:
@@ -567,7 +567,7 @@ public:
|
||||
|
||||
/*! @copydoc any::operator== */
|
||||
[[nodiscard]] bool operator==(const meta_any &other) const noexcept {
|
||||
return (!node.info && !other.node.info) || (node.info && other.node.info && *node.info == *other.node.info && storage == other.storage);
|
||||
return (ctx == other.ctx) && ((!node.info && !other.node.info) || (node.info && other.node.info && *node.info == *other.node.info && storage == other.storage));
|
||||
}
|
||||
|
||||
/*! @copydoc any::operator!= */
|
||||
@@ -1495,7 +1495,7 @@ public:
|
||||
* @return True if the objects refer to the same type, false otherwise.
|
||||
*/
|
||||
[[nodiscard]] bool operator==(const meta_type &other) const noexcept {
|
||||
return (!node.info && !other.node.info) || (node.info && other.node.info && *node.info == *other.node.info);
|
||||
return (ctx == other.ctx) && ((!node.info && !other.node.info) || (node.info && other.node.info && *node.info == *other.node.info));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -63,7 +63,19 @@ TEST_F(MetaContext, Resolve) {
|
||||
TEST_F(MetaContext, MetaType) {
|
||||
using namespace entt::literals;
|
||||
|
||||
// TODO
|
||||
const auto global = entt::resolve<clazz>();
|
||||
const auto local = entt::resolve<clazz>(context);
|
||||
|
||||
ASSERT_TRUE(global);
|
||||
ASSERT_TRUE(local);
|
||||
|
||||
ASSERT_NE(global, local);
|
||||
|
||||
ASSERT_EQ(global, entt::resolve("foo"_hs));
|
||||
ASSERT_EQ(local, entt::resolve(context, "bar"_hs));
|
||||
|
||||
ASSERT_EQ(global.id(), "foo"_hs);
|
||||
ASSERT_EQ(local.id(), "bar"_hs);
|
||||
}
|
||||
|
||||
TEST_F(MetaContext, MetaBase) {
|
||||
|
||||
Reference in New Issue
Block a user