| Directory: | ./ |
|---|---|
| File: | tmp_project/PhoenixString/TESTS/TEST_FILESIZE/main.cpp |
| Date: | 2024-12-09 15:28:54 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 9 | 9 | 100.0% |
| Branches: | 19 | 19 | 100.0% |
| 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 "string_filename.h" | ||
| 11 | #include "phoenix_getFileSize.h" | ||
| 12 | |||
| 13 | ///Test the whoami function | ||
| 14 | 1 | void testStringFileSize(){ | |
| 15 |
7/7✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
|
1 | phoenix_assert(saveFileContent("testFile.txt", "some file content")); |
| 16 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
|
1 | size_t fileSize(phoenix_getFileSize("testFile.txt")); |
| 17 |
4/4✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
|
1 | phoenix_assert(fileSize != 0lu); |
| 18 |
6/6✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
|
1 | phoenix_assert(phoenix_getFileSize("UnexistingFile.txt") == 0lu); |
| 19 | 1 | } | |
| 20 | |||
| 21 | |||
| 22 | 1 | int main(int argc, char** argv){ | |
| 23 | 1 | testStringFileSize(); | |
| 24 | 1 | return 0; | |
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 |