GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/FileParser/TESTS/TEST_PARSER_INDENTATION/main.cpp Lines: 14 14 100.0 %
Date: 2024-09-10 03:06:26 Branches: 13 13 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 "PFileParser.h"
11
12
///Check the PFileParser
13
1
void checkParserIndentation(){
14
2
	PFileParser parser;
15
1
	parser.setFileContent("no indentation\n\tHere one\n\t\there two\n   Here three\n One\nZero\n    Four\n");
16
17
1
	size_t tabGoodIndentation[] = {0lu, 1lu, 2lu, 3lu, 1lu, 0lu, 4lu};
18
1
	size_t i(0lu);
19
8
	while(!parser.isEndOfFile()){
20
7
		size_t currentIndentation(parser.getLineIndentation());
21
7
		parser.getUntilKeyWithoutPatern("\n");
22

7
		phoenix_assert(tabGoodIndentation[i] == currentIndentation);
23
7
		++i;
24
	}
25
1
}
26
27
28
1
int main(int argc, char** argv){
29
1
	checkParserIndentation();
30
1
	return 0;
31
}
32
33