Skip to content

Commit fb35a82

Browse files
committed
Tests for bool members
[SVN r32813]
1 parent 44c5c18 commit fb35a82

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/data_members.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct Y : test_class<1>
2121
{
2222
Y(int v) : test_class<1>(v) {}
2323
Y& operator=(Y const& rhs) { x = rhs.x; return *this; }
24+
bool q;
2425
};
2526

2627
double get_fair_value(X const& x) { return x.value(); }
@@ -96,6 +97,7 @@ BOOST_PYTHON_MODULE(data_members_ext)
9697
.def("value", &Y::value)
9798
.def("set", &Y::set)
9899
.def_readwrite("x", &Y::x)
100+
.def_readwrite("q", &Y::q)
99101
;
100102

101103
class_<Var>("Var", init<std::string>())

test/data_members.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
>>> v.rw2b.x
4343
777
4444
>>> Var.rw2b = Y(888)
45+
46+
>>> y = Y(99)
47+
>>> y.q = True
48+
>>> y.q
49+
True
50+
>>> y.q = False
51+
>>> y.q
52+
False
53+
4554
>>> Var.ro2a.x
4655
888
4756
>>> Var.ro2b.x

0 commit comments

Comments
 (0)