X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fmpl.test.cc;h=9e80f68a3e82bd880f05c8d5983a1a204e912abe;hb=498e46942326c504b30ebdbb5e4d9be1b48d2b5f;hp=9935670c9211df2f4226cf65a62c30d0979fbaec;hpb=21bad90912447cd2d390112cf2d2a7d383ad8058;p=senf.git diff --git a/Utils/mpl.test.cc b/Utils/mpl.test.cc index 9935670..9e80f68 100644 --- a/Utils/mpl.test.cc +++ b/Utils/mpl.test.cc @@ -29,7 +29,7 @@ // Custom includes #include "mpl.hh" -#include +#include "../Utils/auto_unit_test.hh" #include #define prefix_ @@ -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_