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