aboutsummaryrefslogtreecommitdiff
path: root/tests/test/simple/generated/driver.cxx
blob: 1d911df966c26b797fc1c24143662e84eb621c7d (plain)
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
// file      : tests/test/simple/generated/driver.cxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#include <string>
#include <fstream>
#include <iostream>

using namespace std;

int
main (int argc, char* argv[])
{
  int r (0);

  if (argc == 1)
  {
    cout << "1.2.3" << endl;
  }
  else
  {
    ifstream ifs (argv[1]);

    if (!ifs.is_open ())
      cerr << "unable to open " << argv[1] << endl;

    string s;
    r = getline (ifs, s) && s == "1.2.3" ? 0 : 1;
  }

  return r;
}