18 std::cout <<
"checkKeyMapValue : map NULL for expectedValue = '"<<expectedValue<<
"'" << std::endl;
19 return expectedValue ==
"";
22 bool b(mapKey->
getValue() == expectedValue);
34 std::cout <<
"checkKeyMapVecValue : map NULL for vecExpectedValue = " << std::endl;
36 return vecExpectedValue.size() == 0lu;
42 b &= vecValue.size() == vecExpectedValue.size();
44 VecDicoValue::const_iterator it(vecValue.begin());
45 PVecString::const_iterator itRef(vecExpectedValue.begin());
46 while(b && it != vecValue.end() && itRef != vecExpectedValue.end()){
47 b &= it->getValue() == *itRef;
48 std::cout <<
"\tvalue = '" << it->getValue() <<
"', reference = '"<< *itRef <<
"', isOk = " << b << std::endl;
65 PString fileContent(
"[package]\nname = \"hello_hdf5\"\ndescription = \"some string in double quotes\"\nenable_option = true\ndisable_option = false\n\n");
66 PPath tomlFile(
"test.toml");
85 DicoValue * mapPackageEnableOption = mapPackage->
getMap(
"enable_option");
88 DicoValue * mapPackageDisableOption = mapPackage->
getMap(
"disable_option");
94 PString fileContent(
"[package]\nname = \"hello_hdf5\"\ndescription = 'some string in simple quotes'\nsome_list = [\"one\", \"two\", \"three\"]\nlist_value = [1, 2, 3, 4]\n\n[dependencies]\nhdf5 = \"0.8.1\"\nndarray = '0.15.6'\n\n");
96 PPath tomlFile(
"test_toml_list.toml");
117 vecExpectedValue.push_back(
"\"one\"");
118 vecExpectedValue.push_back(
"\"two\"");
119 vecExpectedValue.push_back(
"\"three\"");
127 vecOtherExpectedValue.push_back(
"1");
128 vecOtherExpectedValue.push_back(
"2");
129 vecOtherExpectedValue.push_back(
"3");
130 vecOtherExpectedValue.push_back(
"4");
136 DicoValue * mapDependenciesNdarray = mapDependencies->
getMap(
"ndarray");
142 PString fileContent(
"[package]\nsome_list = []\n\n");
144 PPath tomlFile(
"test_toml_empty_list.toml");
165 PString fileContent(
"[package]\nsome_nested_list = [1, 2, [3, 4]]\n\n");
167 PPath tomlFile(
"test_toml_nested_list.toml");
197 PString fileContent(
"[first.second]\nsome_value = 42\n\n");
199 PPath tomlFile(
"test_toml_nested_map.toml");
217 PString fileContent(
"[[program]]\nname = \"shadok\"\nage = 42\n\n[[program]]\nname = \"gibi\"\nage = 23\n\n");
219 PPath tomlFile(
"test_toml_table.toml");
244 PString fileContent(
"[program]\nname = {url = \"someUrl\"}\nage = 42\n\n");
246 PPath tomlFile(
"test_toml_compact_dico.toml");
265 PString fileContent(
"[program]\nname = {url = \"someUrl\",\n#Some comment\n version = \"1.0.0\"}\n# Some Comment\nage = 42\nemptyDico = {}\n\n");
266 PPath tomlFile(
"test_toml_compact_dico.toml");
312 int main(
int argc,
char** argv){
std::vector< DicoValue > VecDicoValue
Vector of DicoValue.
std::vector< PString > PVecString
int main(int argc, char **argv)
void testCheckValue()
Test if data size is Ok.
void checkTomlList()
Check the embeded dico.
bool checkKeyMapVecValue(const DicoValue *mapKey, const PVecString &vecExpectedValue)
Check the value of a DicoValue.
void checkTomlCompactDico2()
Check the compact dico.
void checkTomTable()
Check the embeded dico.
void checkTomlCompactDico()
Check the compact dico.
void checkTomNestedlMap()
Check the embeded dico.
void checkTomNestedlList()
Check the embeded dico.
void checkParserToml()
Check the YML parser.
bool checkKeyMapValue(const DicoValue *mapKey, const PString &expectedValue)
Check the value of a DicoValue.
void checkParserTomlFail()
Check the YML parser.
void checkTomlEmptyList()
Check the embeded dico.
bool checkIsParserOk(const PPath &fileName, const PString &fileContent)
Check if the parsing of a file is OK.
const std::vector< DicoValue > & getVecChild() const
Gets the vecChild of the DicoValue.
const DicoValue * getMap(const PString &key) const
Get a DicoValue in the map of the current one.
T getValue() const
Convert the value of the current DicoValue into a type.
Path of a directory or a file.
bool saveFileContent(const PString &content) const
Save a PString in a file.
bool parser_toml(DicoValue &dico, const PPath &fileName)
#define phoenix_assert(isOk)
PString phoenix_get_string(const DicoValue &dico, const PString &varName, const PString &defaultValue)
Get the string from a dictionnary.