HepMC3 event record library
HepMC3TestUtils.h
1 #include <iostream>
2 #include <fstream>
3 #include <stdio.h>
4 #include <string.h>
5 
6 using namespace std;
7 
8 int COMPARE_ASCII_FILES(const string& f1,const string& f2)
9 {
10  fstream file1(f1.c_str()), file2(f2.c_str());
11  char string1[16*256], string2[16*256];
12  int j; j = 0;
13  puts("Run comparison");
14  while((!file1.eof())&&(!file2.eof()))
15  {
16  file1.getline(string1,16*256);
17  file2.getline(string2,16*256);
18  j++;
19  if(strcmp(string1,string2) != 0)
20  {
21  cout << j << "-th strings are not equal" << "\n";
22  cout << " " << string1 << "\n";
23  cout << " " << string2 << "\n";
24  return 1;
25  }
26  }
27  return 0;
28 }
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
STL namespace.