PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
phoenix_check_impl.h File Reference
#include <iostream>
#include "PString.h"
#include "convertToString.h"
#include "phoenix_check.h"
+ Include dependency graph for phoenix_check_impl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
bool phoenix_check (const std::string &testName, const std::vector< T > &vecVal, const std::vector< T > &vecRef)
 Check two vector of values. More...
 
template<typename T >
bool phoenix_check (const std::string &testName, const T &val, const T &reference)
 Check two value. More...
 

Function Documentation

◆ phoenix_check() [1/2]

template<typename T >
bool phoenix_check ( const std::string &  testName,
const std::vector< T > &  vecVal,
const std::vector< T > &  vecRef 
)

Check two vector of values.

Parameters
testName: name of the current test
vecVal: vector of values to be checked
vecRef: vector of reference values
Returns
true if val == reference, false otherwise

Definition at line 23 of file phoenix_check_impl.h.

23  {
24  bool b(true);
25  //On this implementation, two vectors of different sizes are not comparable
26  b &= phoenix_check(testName + " size", vecVal.size(), vecRef.size());
27  for(size_t i(0lu); i < vecVal.size() && b; ++i){
28  b &= phoenix_check(testName + " str("+PString::toString(i)+")", vecVal[i], vecRef[i]);
29  }
30  return b;
31 }
static PString toString(const T &value)
Convert a value to a PString.
Definition: PString_impl.h:18
bool phoenix_check(const std::string &testName, const std::vector< T > &vecVal, const std::vector< T > &vecRef)
Check two vector of values.

References phoenix_check(), and PString::toString().

Referenced by phoenix_check().

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

◆ phoenix_check() [2/2]

template<typename T >
bool phoenix_check ( const std::string &  testName,
const T &  val,
const T &  reference 
)

Check two value.

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

Definition at line 40 of file phoenix_check_impl.h.

40  {
41  bool b(val == reference);
42  if(!b){
43  std::cout << "phoenix_check : " << testName << " => " << phoenix_isOk(b) << std::endl;
44  std::cout << "\tval = '"<<PString::toString(val)<<"'" << std::endl;
45  std::cout << "\treference = '"<<PString::toString(reference)<<"'" << std::endl;
46  }
47  return b;
48 }
std::string phoenix_isOk(bool b)
Print OK or FAIL depending on the given boolean.

References phoenix_isOk(), and PString::toString().

+ Here is the call graph for this function: