Skip to content
Snippets Groups Projects
Commit 6af98a4c authored by Thibaut OPRINSEN's avatar Thibaut OPRINSEN
Browse files

add checkvalue function for DataStreamType

parent e3bce967
No related branches found
No related tags found
1 merge request!4add checkvalue function for DataStreamType
Pipeline #392087 passed
......@@ -9,6 +9,30 @@
#include "data_stream_check_value.h"
#include "PMockBackend.h"
///Check given value compare to the reference size
/** @param testName : name of the current test
* @param vecData : vector of data to be checked
* @param vecReferenceData : vector of reference data
* @return true on success, false otherwise
*/
template<>
bool checkValue<DataStreamType>(const std::string & testName, const std::vector<DataStreamType> & vecData, const std::vector<DataStreamType> & vecReferenceData){
if(vecData.size() != vecReferenceData.size()){
std::cout << "checkValue<DataStreamType> : "<<testName<<" => vecData.size(" << vecData.size() << ") != vecReferenceData.size("<<vecReferenceData.size()<<")" << std::endl;
return false;
}
bool b(true);
for(size_t i(0lu); i < vecData.size() && b; ++i){
b &= vecData[i] == vecReferenceData[i];
if(!b){
std::cout << "checkValue<DataStreamType> : "<<testName<<" => vecData["<<i<<"](" << (int)vecData[i] << ") != vecReferenceData["<<i<<"]("<<(int)vecReferenceData[i]<<")" << std::endl;
}
}
// if(b){std::cout << "checkValue : "<<testName<<" => Ok"<<std::endl;}
// else{std::cout << "checkValue : "<<testName<<" => WRONG!!!!"<<std::endl;}
return b;
}
///Default constructor of PMockBackend
PMockBackend::PMockBackend(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment