X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FStudent_OMP%2Fsrc%2Fcpp%2Ftest%2Funit%2F02_Test_Pi%2FTestPi.cpp;fp=WCudaMSE%2FStudent_OMP%2Fsrc%2Fcpp%2Ftest%2Funit%2F02_Test_Pi%2FTestPi.cpp;h=7b23fd9e2907124c9e5f4ad182a4440d833606e1;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Student_OMP/src/cpp/test/unit/02_Test_Pi/TestPi.cpp b/WCudaMSE/Student_OMP/src/cpp/test/unit/02_Test_Pi/TestPi.cpp new file mode 100755 index 0000000..7b23fd9 --- /dev/null +++ b/WCudaMSE/Student_OMP/src/cpp/test/unit/02_Test_Pi/TestPi.cpp @@ -0,0 +1,85 @@ +#include "TestPi.h" +#include + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +extern bool isPiSequentiel_OK(int n); +extern bool isPiOMPEntrelacerPromotionTab_Ok(int n); +extern bool isPiOMPEntrelacerCritical_Ok(int n); +extern bool isPiOMPEntrelacerAtomic_Ok(int n); +extern bool isPiOMPforCritical_Ok(int n); +extern bool isPiOMPforAtomic_Ok(int n); +extern bool isPiOMPforPromotionTab_Ok(int n); +extern bool isPiOMPforReduction_Ok(int n); + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + + +TestPi::TestPi(void) + { + this->n=INT_MAX/10; + + TEST_ADD(TestPi::testSequentiel); + + TEST_ADD(TestPi::testEntrelacerPromotionTab); + TEST_ADD(TestPi::testEntrelacerAtomic); + TEST_ADD(TestPi::testEntrelacerCritical); + + TEST_ADD(TestPi::testAtomic); + TEST_ADD(TestPi::testCritical); + TEST_ADD(TestPi::testPromotionTab); + TEST_ADD(TestPi::testForReduction); + } + +void TestPi::testSequentiel(void) + { + TEST_ASSERT(isPiSequentiel_OK(n)==true); + } + +void TestPi::testEntrelacerPromotionTab(void) + { + TEST_ASSERT(isPiOMPEntrelacerPromotionTab_Ok(n)==true); + } + +void TestPi::testEntrelacerAtomic(void) + { + TEST_ASSERT(isPiOMPEntrelacerAtomic_Ok(n)==true); + } + +void TestPi::testEntrelacerCritical(void) + { + TEST_ASSERT(isPiOMPEntrelacerCritical_Ok(n)==true); + } + +void TestPi::testCritical(void) + { + TEST_ASSERT(isPiOMPforCritical_Ok(n)==true); + } + +void TestPi::testAtomic(void) + { + TEST_ASSERT(isPiOMPforAtomic_Ok(n)==true); + } + +void TestPi::testPromotionTab(void) + { + TEST_ASSERT(isPiOMPforPromotionTab_Ok(n)==true); + } + +void TestPi::testForReduction(void) + { + TEST_ASSERT(isPiOMPforReduction_Ok(n)==true); + } + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +