From 2a5dc20f8a7e0b65a9fe3e5ae94b5d3fb099bcce Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Thu, 1 Jun 2006 12:35:08 +0000 Subject: [PATCH] astyle --style=ansi git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@663 7ec92016-0320-0410-acc4-a06ded1c099a --- test/RegressionTest/FunctorTest.h | 239 ++++++++++++++++-------------- 1 file changed, 124 insertions(+), 115 deletions(-) diff --git a/test/RegressionTest/FunctorTest.h b/test/RegressionTest/FunctorTest.h index 652725f..56150c5 100755 --- a/test/RegressionTest/FunctorTest.h +++ b/test/RegressionTest/FunctorTest.h @@ -25,172 +25,181 @@ void free_function(bool &result) { - result=true; + result=true; } class FunctorTest : public Test { public: - FunctorTest() : Test("Functor.h") {} + FunctorTest() : Test("Functor.h") + {} - virtual void execute(TestResult &result) + virtual void execute(TestResult &result) { - printName(result); + printName(result); - using namespace Loki; + using namespace Loki; - bool r; + bool r; - TestFunctor testFunctor; - TestClass testClass; + TestFunctor testFunctor; + TestClass testClass; #ifndef LOKI_DISABLE_TYPELIST_MACROS - Functor function(testFunction); - Functor function2(testFunction); - Functor functor(testFunctor); - Functor functor2(testFunctor); - Functor classFunctor(&testClass,&TestClass::member); - Functor classFunctor2(&testClass,&TestClass::member); - Functor functorCopy(function); - Functor functorCopy2(function); - Functor bindFunctor(BindFirst(function,testResult)); - Functor bindFunctor2(BindFirst(function,testResult)); + Functor function(testFunction); + Functor function2(testFunction); + Functor functor(testFunctor); + Functor functor2(testFunctor); + Functor classFunctor(&testClass,&TestClass::member); + Functor classFunctor2(&testClass,&TestClass::member); + Functor functorCopy(function); + Functor functorCopy2(function); - Functor chainFunctor(Chain(bindFunctor,bindFunctor)); - Functor chainFunctor2(Chain(bindFunctor,bindFunctor)); + Functor bindFunctor(BindFirst(function,testResult)); + Functor bindFunctor2(BindFirst(function,testResult)); - Functor member_func(&testClass,&TestClass::member); - Functor free_func(&free_function); - Functor NULL_func; - Functor NULL_func0; + Functor chainFunctor(Chain(bindFunctor,bindFunctor)); + Functor chainFunctor2(Chain(bindFunctor,bindFunctor)); + + Functor member_func(&testClass,&TestClass::member); + Functor free_func(&free_function); + Functor NULL_func; + Functor NULL_func0; #else - Functor > function(testFunction); - Functor > function2(testFunction); - Functor > functor(testFunctor); - Functor > functor2(testFunctor); - Functor > classFunctor(&testClass,&TestClass::member); - Functor > classFunctor2(&testClass,&TestClass::member); - Functor > functorCopy(function); - Functor > functorCopy2(function); - //TODO: - //Functor bindFunctor(BindFirst(function,testResult)); - //Functor chainFunctor(Chain(bindFunctor,bindFunctor)); + + Functor > function(testFunction); + Functor > function2(testFunction); + Functor > functor(testFunctor); + Functor > functor2(testFunctor); + Functor > classFunctor(&testClass,&TestClass::member); + Functor > classFunctor2(&testClass,&TestClass::member); + Functor > functorCopy(function); + Functor > functorCopy2(function); + //TODO: + //Functor bindFunctor(BindFirst(function,testResult)); + //Functor chainFunctor(Chain(bindFunctor,bindFunctor)); #endif - testResult=false; - function(testResult); - bool functionResult=testResult; + testResult=false; + function(testResult); + bool functionResult=testResult; - testResult=false; - functor(testResult); - bool functorResult=testResult; + testResult=false; + functor(testResult); + bool functorResult=testResult; - testResult=false; - classFunctor(testResult); - bool classFunctorResult=testResult; + testResult=false; + classFunctor(testResult); + bool classFunctorResult=testResult; - testResult=false; - functorCopy(testResult); - bool functorCopyResult=testResult; + testResult=false; + functorCopy(testResult); + bool functorCopyResult=testResult; -#ifdef LOKI_FUNCTORS_ARE_COMPARABLE +#ifdef LOKI_FUNCTORS_ARE_COMPARABLE - bool functionCompare = function==function2; - bool functorCompare = functor!=functor2; // is this a bug? - bool classFunctorCompare = classFunctor==classFunctor2; - bool functorCopyCompare = functorCopy==functorCopy2; + bool functionCompare = function==function2; + bool functorCompare = functor!=functor2; // is this a bug? + bool classFunctorCompare = classFunctor==classFunctor2; + bool functorCopyCompare = functorCopy==functorCopy2; - bool free_mem = free_func!=member_func; - bool mem_free = member_func!=free_func; + bool free_mem = free_func!=member_func; + bool mem_free = member_func!=free_func; - bool null0 = NULL_func == NULL_func0; - bool null1 = NULL_func != free_func; - bool null2 = NULL_func != member_func; - bool null3 = free_func != NULL_func; - bool null4 = member_func != NULL_func; + bool null0 = NULL_func == NULL_func0; + bool null1 = NULL_func != free_func; + bool null2 = NULL_func != member_func; + bool null3 = free_func != NULL_func; + bool null4 = member_func != NULL_func; #ifdef LOKI_DISABLE_TYPELIST_MACROS - bool bindFunctorCompare = bindFunctor==bindFunctor2; - bool chainFunctorCompare = chainFunctor==chainFunctor2; + + bool bindFunctorCompare = bindFunctor==bindFunctor2; + bool chainFunctorCompare = chainFunctor==chainFunctor2; #endif - bool compare = functionCompare && - functorCompare && - classFunctorCompare && - functorCopyCompare && - mem_free && - free_mem && - null0 && - null1 && - null2 && - null3 && - null4 + bool compare = functionCompare && + functorCompare && + classFunctorCompare && + functorCopyCompare && + mem_free && + free_mem && + null0 && + null1 && + null2 && + null3 && + null4 #ifndef LOKI_DISABLE_TYPELIST_MACROS - ; + ; #else - && bindFunctorCompare - && chainFunctorCompare; + + && bindFunctorCompare + && chainFunctorCompare; #endif #else - bool compare=true; + + bool compare=true; #endif //LOKI_FUNCTORS_ARE_COMPARABLE #ifdef LOKI_DISABLE_TYPELIST_MACROS - testResult=false; - bindFunctor(); - bool bindFunctorResult=testResult; - testResult=false; - chainFunctor(); - bool chainFunctorResult=testResult; + testResult=false; + bindFunctor(); + bool bindFunctorResult=testResult; - r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult && - chainFunctorResult && compare; - #else - //TODO! - r=functionResult && functorResult && classFunctorResult && functorCopyResult && compare; - #endif - testAssert("Functor",r,result); + testResult=false; + chainFunctor(); + bool chainFunctorResult=testResult; - std::cout << '\n'; + r=functionResult && functorResult && classFunctorResult && functorCopyResult && bindFunctorResult && + chainFunctorResult && compare; +#else + //TODO! + r=functionResult && functorResult && classFunctorResult && functorCopyResult && compare; +#endif + + testAssert("Functor",r,result); + + std::cout << '\n'; } private: - static bool testResult; + static bool testResult; - static void testFunction(bool &result) + static void testFunction(bool &result) { - result=true; + result=true; } - class TestFunctor - { - public: - void operator()(bool &result) - { - result=true; - } - bool operator==(const TestFunctor& rhs) const - { - const TestFunctor* p = &rhs; - return this==p; - } - }; + class TestFunctor + { + public: + void operator()(bool &result) + { + result=true; + } + bool operator==(const TestFunctor& rhs) const + { + const TestFunctor* p = &rhs; + return this==p; + } + }; - class TestClass - { - public: - void member(bool &result) - { - result=true; - } - }; -} functorTest; + class TestClass + { + public: + void member(bool &result) + { + result=true; + } + }; +} +functorTest; bool FunctorTest::testResult;