Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_OMP / src / cpp / test / unit / 02_Test_Pi / TestPi.cpp
1 #include "TestPi.h"
2 #include <limits.h>
3
4 /*----------------------------------------------------------------------*\
5 |* Declaration *|
6 \*---------------------------------------------------------------------*/
7
8 /*--------------------------------------*\
9 |* Imported *|
10 \*-------------------------------------*/
11
12 extern bool isPiSequentiel_OK(int n);
13 extern bool isPiOMPEntrelacerPromotionTab_Ok(int n);
14 extern bool isPiOMPEntrelacerCritical_Ok(int n);
15 extern bool isPiOMPEntrelacerAtomic_Ok(int n);
16 extern bool isPiOMPforCritical_Ok(int n);
17 extern bool isPiOMPforAtomic_Ok(int n);
18 extern bool isPiOMPforPromotionTab_Ok(int n);
19 extern bool isPiOMPforReduction_Ok(int n);
20
21 /*----------------------------------------------------------------------*\
22 |* Implementation *|
23 \*---------------------------------------------------------------------*/
24
25
26 TestPi::TestPi(void)
27 {
28 this->n=INT_MAX/10;
29
30 TEST_ADD(TestPi::testSequentiel);
31
32 TEST_ADD(TestPi::testEntrelacerPromotionTab);
33 TEST_ADD(TestPi::testEntrelacerAtomic);
34 TEST_ADD(TestPi::testEntrelacerCritical);
35
36 TEST_ADD(TestPi::testAtomic);
37 TEST_ADD(TestPi::testCritical);
38 TEST_ADD(TestPi::testPromotionTab);
39 TEST_ADD(TestPi::testForReduction);
40 }
41
42 void TestPi::testSequentiel(void)
43 {
44 TEST_ASSERT(isPiSequentiel_OK(n)==true);
45 }
46
47 void TestPi::testEntrelacerPromotionTab(void)
48 {
49 TEST_ASSERT(isPiOMPEntrelacerPromotionTab_Ok(n)==true);
50 }
51
52 void TestPi::testEntrelacerAtomic(void)
53 {
54 TEST_ASSERT(isPiOMPEntrelacerAtomic_Ok(n)==true);
55 }
56
57 void TestPi::testEntrelacerCritical(void)
58 {
59 TEST_ASSERT(isPiOMPEntrelacerCritical_Ok(n)==true);
60 }
61
62 void TestPi::testCritical(void)
63 {
64 TEST_ASSERT(isPiOMPforCritical_Ok(n)==true);
65 }
66
67 void TestPi::testAtomic(void)
68 {
69 TEST_ASSERT(isPiOMPforAtomic_Ok(n)==true);
70 }
71
72 void TestPi::testPromotionTab(void)
73 {
74 TEST_ASSERT(isPiOMPforPromotionTab_Ok(n)==true);
75 }
76
77 void TestPi::testForReduction(void)
78 {
79 TEST_ASSERT(isPiOMPforReduction_Ok(n)==true);
80 }
81
82 /*----------------------------------------------------------------------*\
83 |* End *|
84 \*---------------------------------------------------------------------*/
85