PhoenixZMQ  2.0.0
Library which integrates zeromq use in Phoenix
PMockBackend.cpp File Reference
#include <sstream>
#include "data_stream_check_value.h"
#include "PMockBackend.h"
+ Include dependency graph for PMockBackend.cpp:

Go to the source code of this file.

Functions

template<>
bool checkValue< DataStreamType > (const std::string &testName, const std::vector< DataStreamType > &vecData, const std::vector< DataStreamType > &vecReferenceData)
 Check given value compare to the reference size. More...
 

Function Documentation

◆ checkValue< DataStreamType >()

template<>
bool checkValue< DataStreamType > ( const std::string &  testName,
const std::vector< DataStreamType > &  vecData,
const std::vector< DataStreamType > &  vecReferenceData 
)

Check given value compare to the reference size.

Parameters
testName: name of the current test
vecData: vector of data to be checked
vecReferenceData: vector of reference data
Returns
true on success, false otherwise

Definition at line 19 of file PMockBackend.cpp.

19  {
20  if(vecData.size() != vecReferenceData.size()){
21  std::cout << "checkValue<DataStreamType> : "<<testName<<" => vecData.size(" << vecData.size() << ") != vecReferenceData.size("<<vecReferenceData.size()<<")" << std::endl;
22  return false;
23  }
24  bool b(true);
25  for(size_t i(0lu); i < vecData.size() && b; ++i){
26  b &= vecData[i] == vecReferenceData[i];
27  if(!b){
28  std::cout << "checkValue<DataStreamType> : "<<testName<<" => vecData["<<i<<"](" << (int)vecData[i] << ") != vecReferenceData["<<i<<"]("<<(int)vecReferenceData[i]<<")" << std::endl;
29  }
30  }
31 // if(b){std::cout << "checkValue : "<<testName<<" => Ok"<<std::endl;}
32 // else{std::cout << "checkValue : "<<testName<<" => WRONG!!!!"<<std::endl;}
33  return b;
34 }