GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/FileParser/TESTS/TEST_PLOCATION/main.cpp Lines: 28 28 100.0 %
Date: 2023-10-11 10:52:07 Branches: 40 40 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_check.h"
9
#include "PLocation.h"
10
11
///Check the PLocation
12
/**	@return true on success, false otherwise
13
*/
14
1
bool checkPLocation(){
15
1
	bool b(true);
16
3
	PLocation locRef("someFile.txt", 42, 23);
17
3
	PLocation locCopy(locRef), locEqual;
18
1
	locEqual = locRef;
19
20
1
	b &= locRef == locCopy;
21
1
	b &= locRef == locEqual;
22
23
1
	b &= !(locRef != locCopy);
24
1
	b &= !(locRef != locEqual);
25
26
2
	PLocation locSet;
27
1
	locSet.setFileName("someFile.txt");
28
1
	locSet.setLine(42);
29
1
	locSet.setColumn(23);
30
31
1
	b &= locRef == locSet;
32
1
	b &= !(locRef != locSet);
33
34
1
	b &= locRef.getLine() == locSet.getLine();
35
1
	b &= locRef.getColumn() == locSet.getColumn();
36
1
	b &= locRef.getFileName() == locSet.getFileName();
37
38
1
	std::cout << "checkPLocation : locRef = " << locRef << std::endl;
39
1
	std::cout << "checkPLocation : locCopy = " << locCopy << std::endl;
40
1
	std::cout << "checkPLocation : locEqual = " << locEqual << std::endl;
41
1
	std::cout << "checkPLocation : locSet = " << locSet << std::endl;
42
1
	phoenix_functionOk("checkPLocation", b);
43
2
	return b;
44
}
45
46
47
1
int main(int argc, char** argv){
48
1
	bool b(checkPLocation());
49
1
	phoenix_functionOk("final", b);
50
1
	return b - 1;
51
}
52
53