Directory: | ./ |
---|---|
File: | TESTS/TEST_RANDOM/main.cpp |
Date: | 2024-11-14 16:05:39 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 8 | 8 | 100.0% |
Branches: | 9 | 11 | 81.8% |
Line | Branch | Exec | Source |
---|---|---|---|
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_assert.h" | ||
10 | #include "phoenix_random.h" | ||
11 | |||
12 | ///Test the color | ||
13 | 1 | void testRandom(){ | |
14 | // std::cout << "testRandom : random seed = " << phoenix_initRandom() << std::endl; | ||
15 |
2/2✓ Branch 0 taken 100 times.
✓ Branch 1 taken 1 times.
|
101 | for(size_t i(0lu); i < 100lu; ++i){ |
16 |
1/1✓ Branch 1 taken 100 times.
|
100 | float randVal = phoenix_getRandValue(0.0f, 1.0f); |
17 | // std::cout << "i = " << i << ", randVal = " << randVal << std::endl; | ||
18 |
6/8✓ Branch 2 taken 100 times.
✓ Branch 6 taken 100 times.
✓ Branch 10 taken 100 times.
✓ Branch 12 taken 100 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 100 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 100 times.
|
100 | phoenix_assert(randVal >= 0.0f && randVal < 1.0f); |
19 | } | ||
20 | 1 | } | |
21 | |||
22 | 1 | int main(int argc, char** argv){ | |
23 | 1 | testRandom(); | |
24 | 1 | return 0; | |
25 | } | ||
26 | |||
27 | |||
28 |