PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
phoenix_check.cpp File Reference
#include "convertToString.h"
#include "phoenix_check.h"
+ Include dependency graph for phoenix_check.cpp:

Go to the source code of this file.

Functions

bool phoenix_check (const std::string &testName, const std::list< std::string > &listVal, const std::list< std::string > &listRef)
 Check two list of string. More...
 
bool phoenix_check (const std::string &testName, const std::string &val, const std::string &reference)
 Check two string. More...
 
bool phoenix_check (const std::string &testName, const std::vector< std::string > &listVal, const std::vector< std::string > &listRef)
 Check two vector of string. More...
 

Function Documentation

◆ phoenix_check() [1/3]

bool phoenix_check ( const std::string &  testName,
const std::list< std::string > &  listVal,
const std::list< std::string > &  listRef 
)

Check two list of string.

Parameters
testName: name of the current test
listVal: list of std::string to be checked
listRef: list of reference std::string
Returns
true if val == reference, false otherwise

Definition at line 48 of file phoenix_check.cpp.

48  {
49  bool b(true);
50  //On this implementation, two list of different sizes are not comparable
51  b &= phoenix_check(testName + " size", listVal.size(), listRef.size());
52  std::list<std::string>::const_iterator itVal(listVal.begin());
53  std::list<std::string>::const_iterator itRef(listRef.begin());
54  size_t i(0lu);
55  while(itVal != listVal.end() && itRef != listRef.end() && b){
56  b &= phoenix_check(testName + " str("+valueToString(i)+")", *itVal, *itRef);
57  ++itVal;
58  ++itRef;
59  ++i;
60  }
61  return b;
62 }
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.

References phoenix_check(), and valueToString().

+ Here is the call graph for this function:

◆ phoenix_check() [2/3]

bool phoenix_check ( const std::string &  testName,
const std::string &  val,
const std::string &  reference 
)

Check two string.

Parameters
testName: name of the current test
val: std::string to be checked
reference: reference std::string
Returns
true if val == reference, false otherwise

Definition at line 16 of file phoenix_check.cpp.

16  {
17  bool b(val == reference);
18  if(!b){
19  std::cout << "phoenix_check : " << testName << " => " << phoenix_isOk(b) << std::endl;
20  std::cout << "\tval = '"<<val<<"'" << std::endl;
21  std::cout << "\treference = '"<<reference<<"'" << std::endl;
22  }
23  return b;
24 }
std::string phoenix_isOk(bool b)
Print OK or FAIL depending on the given boolean.

References phoenix_isOk().

Referenced by checkEraseFirstChars(), checkEraseFirstLastChars(), checkEraseLastChars(), checkLoadFromConfig(), checkOpenVecFileStream(), checkOptionCompletion(), checkParser(), checkParseXmlFile(), checkPhoenixCheck(), checkResultConvertToString(), checkString(), checkVarReplaceStr(), checkXmlString(), main(), phoenix_check(), printValueOfOpt(), printValueOfOptConst(), testCheck(), testCheckList(), testCheckVector(), testDicoValueKey(), testEscapeString(), testFromJSonToJSon(), testIsOk(), testPFileParserGetUntilKey(), testPFileParserPartern(), testPFileParserParternExclude(), testPFileParserParternRecurse(), testPFileParserParternRecurse2(), testPFileParserParternRecurseAllowChar(), testPFileParserParternRecurseExcludeEnd(), testPFileParserParternRecurseExcludeEnd2(), testPFileParserSeq(), testPFileParserSeqOneStep(), testPPathGetExtention(), testPPathGetFileDirName(), testPPathGetUnderPath(), testPPathListAllFileInDir(), testPPathOperator(), and testPPathRemoveDots().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ phoenix_check() [3/3]

bool phoenix_check ( const std::string &  testName,
const std::vector< std::string > &  listVal,
const std::vector< std::string > &  listRef 
)

Check two vector of string.

Parameters
testName: name of the current test
listVal: list of std::string to be checked
listRef: list of reference std::string
Returns
true if val == reference, false otherwise

Definition at line 32 of file phoenix_check.cpp.

32  {
33  bool b(true);
34  //On this implementation, two vectors of different sizes are not comparable
35  b &= phoenix_check(testName + " size", listVal.size(), listRef.size());
36  for(size_t i(0lu); i < listVal.size() && b; ++i){
37  b &= phoenix_check(testName + " str("+valueToString(i)+")", listVal[i], listRef[i]);
38  }
39  return b;
40 }

References phoenix_check(), and valueToString().

+ Here is the call graph for this function: