PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
phoenix_check.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #include "phoenix_check.h"
8 
10 
15 bool phoenix_check(const std::string & testName, const std::string & val, const std::string & reference){
16  bool b(val == reference);
17  if(!b){
18  std::cout << "phoenix_check : " << testName << " => " << phoenix_isOk(b) << std::endl;
19  std::cout << "\tval = '"<<val<<"'" << std::endl;
20  std::cout << "\treference = '"<<reference<<"'" << std::endl;
21  }
22  return b;
23 }
24 
26 
31 bool phoenix_check(const std::string & testName, const std::list<std::string> & listVal, const std::list<std::string> & listRef){
32  bool b(true);
33  //On this implementation, two list of different sizes are not comparable
34  b &= phoenix_check(testName + " size", listVal.size(), listRef.size());
35  std::list<std::string>::const_iterator itVal(listVal.begin());
36  std::list<std::string>::const_iterator itRef(listRef.begin());
37  size_t i(0lu);
38  while(itVal != listVal.end() && itRef != listRef.end() && b){
39  b &= phoenix_check(testName + " str("+valueToString(i)+")", *itVal, *itRef);
40  ++itVal;
41  ++itRef;
42  ++i;
43  }
44  return b;
45 }
46 
47 
48 
49 
std::string valueToString(const T &val)
Convert a type into a string.
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.
std::string phoenix_isOk(bool b)
Print OK or FAIL depending on the given boolean.