Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_OMP / src / cpp / test / unit / 02_Test_Pi / TestPi.cpp
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 (executable)
index 0000000..7b23fd9
--- /dev/null
@@ -0,0 +1,85 @@
+#include "TestPi.h"\r
+#include <limits.h>\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Imported                *|\r
+ \*-------------------------------------*/\r
+\r
+extern bool isPiSequentiel_OK(int n);\r
+extern bool isPiOMPEntrelacerPromotionTab_Ok(int n);\r
+extern bool isPiOMPEntrelacerCritical_Ok(int n);\r
+extern bool isPiOMPEntrelacerAtomic_Ok(int n);\r
+extern bool isPiOMPforCritical_Ok(int n);\r
+extern bool isPiOMPforAtomic_Ok(int n);\r
+extern bool isPiOMPforPromotionTab_Ok(int n);\r
+extern bool isPiOMPforReduction_Ok(int n);\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+\r
+TestPi::TestPi(void)\r
+    {\r
+    this->n=INT_MAX/10;\r
+\r
+    TEST_ADD(TestPi::testSequentiel);\r
+\r
+    TEST_ADD(TestPi::testEntrelacerPromotionTab);\r
+    TEST_ADD(TestPi::testEntrelacerAtomic);\r
+    TEST_ADD(TestPi::testEntrelacerCritical);\r
+\r
+    TEST_ADD(TestPi::testAtomic);\r
+    TEST_ADD(TestPi::testCritical);\r
+    TEST_ADD(TestPi::testPromotionTab);\r
+    TEST_ADD(TestPi::testForReduction);\r
+    }\r
+\r
+void TestPi::testSequentiel(void)\r
+    {\r
+    TEST_ASSERT(isPiSequentiel_OK(n)==true);\r
+    }\r
+\r
+void TestPi::testEntrelacerPromotionTab(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPEntrelacerPromotionTab_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testEntrelacerAtomic(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPEntrelacerAtomic_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testEntrelacerCritical(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPEntrelacerCritical_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testCritical(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPforCritical_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testAtomic(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPforAtomic_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testPromotionTab(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPforPromotionTab_Ok(n)==true);\r
+    }\r
+\r
+void TestPi::testForReduction(void)\r
+    {\r
+    TEST_ASSERT(isPiOMPforReduction_Ok(n)==true);\r
+    }\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r
+\r