1 |
|
|
|
2 |
|
|
/*************************************** |
3 |
|
|
Auteur : Pierre Aubert |
4 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
5 |
|
|
Licence : CeCILL-C |
6 |
|
|
****************************************/ |
7 |
|
|
|
8 |
|
|
#include <iostream> |
9 |
|
|
#include "phoenix_random.h" |
10 |
|
|
|
11 |
|
|
///Test the color |
12 |
|
|
/** @return true on success, false otherwise |
13 |
|
|
*/ |
14 |
|
1 |
bool testRandom(){ |
15 |
|
1 |
std::cout << "testRandom : random seed = " << phoenix_initRandom() << std::endl; |
16 |
|
1 |
bool b(true); |
17 |
|
|
|
18 |
✓✓ |
101 |
for(size_t i(0lu); i < 100lu; ++i){ |
19 |
✓ |
100 |
float randVal = phoenix_getRandValue(0.0f, 1.0f); |
20 |
|
100 |
std::cout << "i = " << i << ", randVal = " << randVal << std::endl; |
21 |
✓✗✓✗
|
100 |
b &= randVal >= 0.0f && randVal < 1.0f; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
1 |
std::cout << "testRandom : b = " << b << std::endl; |
25 |
|
1 |
return b; |
26 |
|
|
} |
27 |
|
|
|
28 |
|
1 |
int main(int argc, char** argv){ |
29 |
|
1 |
bool b(true); |
30 |
|
1 |
b &= testRandom(); |
31 |
|
1 |
std::cout << "Final : b = " << b << std::endl; |
32 |
|
1 |
return b - 1; |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
|