| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "PImagePng.h" | ||
| 8 | |||
| 9 | ///Test the write of a png file | ||
| 10 | /** @return true on success, false otherwise | ||
| 11 | */ | ||
| 12 | 5 | bool testWriteColorPng(const PPath & fileName, color_t red, color_t green, color_t blue){ | |
| 13 | 5 | bool b(true); | |
| 14 | |||
| 15 | 5 | size_t width(640lu), height(480lu); | |
| 16 |
1/1✓ Branch 0 (2→3) taken 5 times.
|
5 | PImagePng image; |
| 17 |
1/1✓ Branch 0 (3→4) taken 5 times.
|
5 | b &= image.createImage(width, height); |
| 18 |
1/1✓ Branch 0 (4→5) taken 5 times.
|
5 | image.fill(red, green, blue); |
| 19 |
1/1✓ Branch 0 (5→6) taken 5 times.
|
5 | b &= image.write(fileName); |
| 20 | |||
| 21 | 5 | return b; | |
| 22 | 5 | } | |
| 23 | |||
| 24 | 1 | int main(int argc, char** argv){ | |
| 25 | 1 | bool b(true); | |
| 26 |
3/3✓ Branch 0 (2→3) taken 1 times.
✓ Branch 2 (3→4) taken 1 times.
✓ Branch 4 (4→5) taken 1 times.
|
1 | b &= testWriteColorPng(PPath("outputFillRed.png"), 255, 0, 0); |
| 27 |
3/3✓ Branch 0 (7→8) taken 1 times.
✓ Branch 2 (8→9) taken 1 times.
✓ Branch 4 (9→10) taken 1 times.
|
1 | b &= testWriteColorPng(PPath("outputFillGreen.png"), 0, 255, 0); |
| 28 |
3/3✓ Branch 0 (12→13) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
✓ Branch 4 (14→15) taken 1 times.
|
1 | b &= testWriteColorPng(PPath("outputFillBlue.png"), 0, 0, 255); |
| 29 |
3/3✓ Branch 0 (17→18) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
✓ Branch 4 (19→20) taken 1 times.
|
1 | b &= testWriteColorPng(PPath("outputFillBlack.png"), 0, 0, 0); |
| 30 |
3/3✓ Branch 0 (22→23) taken 1 times.
✓ Branch 2 (23→24) taken 1 times.
✓ Branch 4 (24→25) taken 1 times.
|
1 | b &= testWriteColorPng(PPath("outputFillWhite.png"), 255, 255, 255); |
| 31 | 1 | return b - 1; | |
| 32 | } | ||
| 33 | |||
| 34 |