Update of /cvsroot/luabind/luabind/luabind/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29680/test
Modified Files:
Tag: beta7-devel2
test_attributes.cpp
Log Message:
def_readwrite and def_readonly will now return references if the bound memeber type is not a primitive type
Index: test_attributes.cpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/test/test_attributes.cpp,v
retrieving revision 1.31.2.2
retrieving revision 1.31.2.3
diff -u -d -r1.31.2.2 -r1.31.2.3
--- test_attributes.cpp 4 Sep 2005 20:57:04 -0000 1.31.2.2
+++ test_attributes.cpp 24 Oct 2005 09:44:00 -0000 1.31.2.3
@@ -35,6 +35,11 @@
{
};
+struct C
+{
+ int a;
+};
+
struct property_test : counted_type<property_test>
{
property_test(): o(6) {}
@@ -43,6 +48,7 @@
int a_;
float o;
signed char b;
+ C c;
void set(int a) { a_ = a; }
int get() const { return a_; }
@@ -79,7 +85,8 @@
.property("A", &property_test::getA, &property_test::setA)
.def_readonly("o", &property_test::o)
.property("free", &free_getter, &free_setter)
- .def_readwrite("b", &property_test::b),
+ .def_readwrite("b", &property_test::b)
+ .def_readwrite("c", &property_test::c),
class_<A>("A")
.def(constructor<>())
@@ -87,7 +94,11 @@
class_<B, A>("B")
.def(constructor<>())
- .property("x", &A::get)
+ .property("x", &A::get),
+
+ class_<C>("C")
+ .def(constructor<>())
+ .def_readwrite("a", &C::a)
];
DOSTRING(L, "test = property()\n");
@@ -122,6 +133,9 @@
"test.b = 3\n"
"assert(test.b == 3)\n");
+ DOSTRING(L, "test.c.a = 1\n"
+ "assert(test.c.a == 1)\n");
+
DOSTRING(L,
"a = B()\n");
|