Make shared_ptr_converter public.
[luabind.git] / test / test_class_info.cpp
blob435694839f657a26ca6cbd3565b31b326b575151
1 // Copyright Daniel Wallin 2009. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include "test.hpp"
6 #include <luabind/luabind.hpp>
7 #include <luabind/class_info.hpp>
9 struct X
11 void f()
14 int x;
15 int y;
18 void test_main(lua_State* L)
20 using namespace luabind;
22 bind_class_info(L);
24 module(L) [
25 class_<X>("X")
26 .def(constructor<>())
27 .def("f", &X::f)
28 .def_readonly("x", &X::x)
29 .def_readonly("y", &X::y)
32 DOSTRING(L,
33 "x = X()\n"
34 "info = class_info(x)\n"
35 "assert(info.name == 'X')\n"
36 "assert(info.methods['f'] == x.f)\n"
37 "assert(info.methods['__init'] == x.__init)\n"
38 "assert(info.attributes[1] == 'y')\n"
39 "assert(info.attributes[2] == 'x')\n"