16 #define GETTEXT_DOMAIN "wesnoth-test"
19 #include <boost/test/unit_test.hpp>
29 std::vector<dummy_object> vec;
30 auto& obj = vec.emplace_back(
"test");
31 BOOST_CHECK_EQUAL(obj.value,
"test");
34 BOOST_CHECK_EQUAL(ptr.
get_ptr(), &obj);
37 auto obj2 = std::move(obj);
39 BOOST_CHECK_EQUAL(ptr.
get_ptr(), &obj2);
40 BOOST_CHECK_EQUAL(ptr->value,
"test");
44 BOOST_CHECK(!ptr_from_moved_object);
48 obj3 = std::move(obj2);
50 BOOST_CHECK_EQUAL(ptr.
get_ptr(), &obj3);
51 BOOST_CHECK_EQUAL(ptr->value,
"test");
55 BOOST_CHECK_EQUAL(ptr->value,
"test");
56 BOOST_CHECK(!ptr_from_moved_object);
Allows creation of lua_ptr<T> instances, but does not affect the lifetime of the T itself.
T must inherit enable_lua_ptr<T>
dummy_object(const std::string &s)
BOOST_AUTO_TEST_CASE(test_lua_ptr)
static map_location::direction s