GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/FileParser/TESTS/TEST_PARSER_YML/main_list_map.cpp Lines: 21 21 100.0 %
Date: 2024-09-10 03:06:26 Branches: 28 35 80.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 <assert.h>
9
#include "parser_yml.h"
10
11
///Check the YML parser
12
/**	@param ymlFile : file to be used for the test
13
*/
14
2
void checkParserYml(const std::string & ymlFile){
15
4
	DicoValue dico;
16
2
	assert(parser_yml(dico, ymlFile));
17

2
	std::cout << "checkParserYml("<<ymlFile<<") : output DicoValue :" << std::endl;
18
2
	dico.print();
19
2
	const DicoValue * mapImageDef = dico.getMap("images_definition");
20
2
	assert(mapImageDef != NULL);
21
2
	if(mapImageDef != NULL){
22
2
		const VecDicoValue & vecImage = mapImageDef->getVecChild();
23
2
		assert(vecImage.size() == 4lu);
24
10
		for(VecDicoValue::const_iterator it(vecImage.begin()); it != vecImage.end(); ++it){
25
8
			const DicoValue * dicoImage = it->getMap("image");
26
8
			assert(dicoImage != NULL);
27
8
			const DicoValue * dicoName = dicoImage->getMap("name");
28
8
			assert(dicoName != NULL);
29
8
			assert(dicoName->getValue() == "value");
30
		}
31
	}
32
2
}
33
34
1
int main(int argc, char** argv){
35
1
	checkParserYml(LIST_MAP_YML_CONFIG);
36
1
	checkParserYml(LIST_MAP_YML_CONFIG_NO_INDENT);
37
1
	return 0;
38
}
39
40