Files
entt/test/lib/locator/shared/main.cpp
2026-03-03 10:10:46 +01:00

23 lines
643 B
C++

#include <gtest/gtest.h>
#include <entt/config/config.h>
#include <entt/locator/locator.hpp>
#include "../../../common/value_type.h"
#include "lib.h"
TEST(Locator, Shared) {
entt::locator<test::boxed_int>::emplace().value = 4;
ASSERT_EQ(entt::locator<test::boxed_int>::value().value, 4);
set_up(entt::locator<test::boxed_int>::handle());
use_service(3);
ASSERT_EQ(entt::locator<test::boxed_int>::value().value, 3);
// service updates do not propagate across boundaries
entt::locator<test::boxed_int>::emplace().value = 4;
use_service(3);
ASSERT_EQ(entt::locator<test::boxed_int>::value().value, 4);
}