X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fmpl.test.cc;h=5e69658123c33e9e8ec980a97a3d935b92bc4261;hb=9bfe0b87be0926193b5baf13865cf045f0de0b0d;hp=9935670c9211df2f4226cf65a62c30d0979fbaec;hpb=21bad90912447cd2d390112cf2d2a7d383ad8058;p=senf.git diff --git a/Utils/mpl.test.cc b/Utils/mpl.test.cc index 9935670..5e69658 100644 --- a/Utils/mpl.test.cc +++ b/Utils/mpl.test.cc @@ -82,6 +82,33 @@ BOOST_AUTO_UNIT_TEST(senfmpl) BOOST_CHECK( ! choice::has_class_value ); } +namespace { + +# define Begin() SENF_MPL_SLOT_DEF(accum, 0) +# define Add(n) SENF_MPL_SLOT_SET(accum, SENF_MPL_SLOT_GET(accum)+n) +# define End() BOOST_STATIC_CONSTANT(unsigned, total = SENF_MPL_SLOT_GET(accum)) + + struct Test + { + Begin(); + + Add(2); + Add(2); + + // Here some comment ... + + Add(4); + + End(); + }; + +} + +BOOST_AUTO_UNIT_TEST(mplSlot) +{ + BOOST_CHECK_EQUAL( unsigned(Test::total), 8u ); +} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_