GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/FileParser/TESTS/TEST_FILE_UTILS/main.cpp Lines: 13 13 100.0 %
Date: 2024-09-10 03:06:26 Branches: 51 51 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 "phoenix_assert.h"
9
#include "phoenix_check.h"
10
#include "file_utils.h"
11
12
///Check the file utils
13
1
void testFileUtils(){
14

1
	phoenix_assert(getFileName("someDir/with/someFile.txt") == "someFile.txt");
15

1
	phoenix_assert(getFileName("someDir/with/") == "");
16

1
	phoenix_assert(getFileName("") == "");
17

1
	phoenix_assert(getFileContent("SomeInexistingFile") == "");
18

1
	phoenix_assert(getFileContent("Makefile") != "");
19

1
	phoenix_assert(saveFileContent("file.txt", "content"));
20

1
	phoenix_assert(saveFileContent("file2.txt", ""));
21

1
	phoenix_assert(!saveFileContent("", "whatever"));
22
1
}
23
24
1
int main(int argc, char** argv){
25
1
	testFileUtils();
26
1
	return 0;
27
}
28
29