File: HepMC3TestUtils.h

package info (click to toggle)
hepmc3 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 14,116 kB
  • sloc: fortran: 66,849; cpp: 13,604; ansic: 1,374; xml: 109; sh: 72; makefile: 33
file content (39 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>

using namespace std;

int COMPARE_ASCII_FILES(const string& f1,const string& f2)
{
    fstream file1(f1.c_str()), file2(f2.c_str());
    char string1[16*256], string2[16*256];
    int j;
    j = 0;
    puts("Run comparison");
    while((!file1.eof())&&(!file2.eof()))
    {
        file1.getline(string1,16*256);
        file2.getline(string2,16*256);
        j++;
        if(strcmp(string1,string2) != 0)
        {
            cout << j << "-th strings are not equal" << "\n";
            cout << "   " << string1 << "\n";
            cout << "   " << string2 << "\n";
            return 1;
        }
    }
    return 0;
}