diff --git a/tests/40components.tests b/tests/40components.tests index 585be3d6f..1bc9b1717 100644 --- a/tests/40components.tests +++ b/tests/40components.tests @@ -356,6 +356,10 @@ out: ::12::11::10::9::8::7::6::5::4::3 END +PLANNED "Iterable type detection" IterableClassification_test < + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "lib/test/run.hpp" + +#include "proc/mobject/session/scope-query.hpp" +#include "proc/mobject/session/effect.hpp" +#include "lib/meta/duck-detector.hpp" +#include "lib/util-foreach.hpp" +#include "lib/itertools.hpp" +#include "lib/lumitime.hpp" + +#include +#include +#include +#include +#include +#include + + +namespace lib { +/////////////////////////////////////////////////////////////TODO draft + + template + struct can_STL_ForEach + { + enum{ value = false }; ////////////////TODO unimplemented + }; + + template + struct can_IterForEach + { + enum{ value = false }; ////////////////TODO unimplemented + }; + +/////////////////////////////////////////////////////////////TODO draft +namespace meta{ +namespace test{ + + using lumiera::Time; + using mobject::session::Effect; + using mobject::session::ScopeQuery; + + using std::cout; + using std::endl; + + + namespace { // a custom test container.... + + + struct TestSource + { + vector data_; + + TestSource(uint num); + + typedef vector::iterator sourceIter; + typedef RangeIter iterator; + + iterator begin() ; + iterator end() ; + // note: a bare type definition is sufficient here.... + }; + + + + }//(End) test containers + +#define SHOW_CHECK(_EXPR_) cout << STRINGIFY(_EXPR_) << "\t : " << (_EXPR_::value? "Yes":"No") << endl; + + + + /*********************************************************************************** + * @test verify the (static) classification/detection of iterables. + * Currently (1/10) we're able to detect the following + * - a STL like container with \c begin() and \c end() + * - a Lumiera Forward Iterator + */ + class IterableClassification_test : public Test + { + + + + void + run (Arg) + { + typedef std::vector LongVector; + typedef std::multiset