astyle --style=ansi
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@663 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
50d35c6196
commit
2a5dc20f8a
1 changed files with 124 additions and 115 deletions
|
@ -31,7 +31,8 @@ void free_function(bool &result)
|
||||||
class FunctorTest : public Test
|
class FunctorTest : public Test
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FunctorTest() : Test("Functor.h") {}
|
FunctorTest() : Test("Functor.h")
|
||||||
|
{}
|
||||||
|
|
||||||
virtual void execute(TestResult &result)
|
virtual void execute(TestResult &result)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +47,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> function(testFunction);
|
Functor<void,LOKI_TYPELIST_1(bool &)> function(testFunction);
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> function2(testFunction);
|
Functor<void,LOKI_TYPELIST_1(bool &)> function2(testFunction);
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> functor(testFunctor);
|
Functor<void,LOKI_TYPELIST_1(bool &)> functor(testFunctor);
|
||||||
|
@ -66,6 +68,7 @@ public:
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> NULL_func;
|
Functor<void,LOKI_TYPELIST_1(bool &)> NULL_func;
|
||||||
Functor<void,LOKI_TYPELIST_1(bool &)> NULL_func0;
|
Functor<void,LOKI_TYPELIST_1(bool &)> NULL_func0;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
Functor<void,Seq<bool &> > function(testFunction);
|
Functor<void,Seq<bool &> > function(testFunction);
|
||||||
Functor<void,Seq<bool &> > function2(testFunction);
|
Functor<void,Seq<bool &> > function2(testFunction);
|
||||||
Functor<void,Seq<bool &> > functor(testFunctor);
|
Functor<void,Seq<bool &> > functor(testFunctor);
|
||||||
|
@ -113,6 +116,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOKI_DISABLE_TYPELIST_MACROS
|
#ifdef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
bool bindFunctorCompare = bindFunctor==bindFunctor2;
|
bool bindFunctorCompare = bindFunctor==bindFunctor2;
|
||||||
bool chainFunctorCompare = chainFunctor==chainFunctor2;
|
bool chainFunctorCompare = chainFunctor==chainFunctor2;
|
||||||
#endif
|
#endif
|
||||||
|
@ -131,16 +135,19 @@ public:
|
||||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
;
|
;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
&& bindFunctorCompare
|
&& bindFunctorCompare
|
||||||
&& chainFunctorCompare;
|
&& chainFunctorCompare;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
bool compare=true;
|
bool compare=true;
|
||||||
#endif //LOKI_FUNCTORS_ARE_COMPARABLE
|
#endif //LOKI_FUNCTORS_ARE_COMPARABLE
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOKI_DISABLE_TYPELIST_MACROS
|
#ifdef LOKI_DISABLE_TYPELIST_MACROS
|
||||||
|
|
||||||
testResult=false;
|
testResult=false;
|
||||||
bindFunctor();
|
bindFunctor();
|
||||||
bool bindFunctorResult=testResult;
|
bool bindFunctorResult=testResult;
|
||||||
|
@ -151,10 +158,11 @@ public:
|
||||||
|
|
||||||
r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult &&
|
r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult &&
|
||||||
chainFunctorResult && compare;
|
chainFunctorResult && compare;
|
||||||
#else
|
#else
|
||||||
//TODO!
|
//TODO!
|
||||||
r=functionResult && functorResult && classFunctorResult && functorCopyResult && compare;
|
r=functionResult && functorResult && classFunctorResult && functorCopyResult && compare;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
testAssert("Functor",r,result);
|
testAssert("Functor",r,result);
|
||||||
|
|
||||||
std::cout << '\n';
|
std::cout << '\n';
|
||||||
|
@ -190,7 +198,8 @@ private:
|
||||||
result=true;
|
result=true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} functorTest;
|
}
|
||||||
|
functorTest;
|
||||||
|
|
||||||
bool FunctorTest::testResult;
|
bool FunctorTest::testResult;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue