ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
int streamdiff ( std::istream &  stream1,
std::istream &  stream2,
std::stringstream *  ss = NULL 
)
inline

Function to compare two files.

Parameters
std::istream&stream1 File 1 to compare
std::istream&stream2 File 2 to compare
std::stringstream*ss Optional argument which returns the lines that differ

Definition at line 296 of file ElmerModuleDriverTest.H.

Referenced by TestingObject< ResultsType >::Test__ElasticBeam3D_LoadFunction().

296  {
297  int retval = 0;
298  std::string line1,line2;
299  while(!stream1.eof()){
300  std::getline(stream1,line1);
301  if(!stream2.eof())
302  std::getline(stream2,line2);
303  if(line1 != line2){
304  if(ss){
305  *ss << "1> " << line1 << std::endl
306  << "2> " << line2 << std::endl;
307  retval = 1;
308  }
309  else
310  return(1);
311  }
312  }
313  if(stream1.eof() != stream2.eof()){
314  return(1);
315  }
316  return(0);
317  }

Here is the caller graph for this function: