diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-05 14:39:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-05 14:39:47 +0200 |
commit | 36ec90018e1a6337d23fc5286ed926c2134bde1f (patch) | |
tree | 40710bf9555076689d1ee7726ec3e29317dba00a /tests/test/simple/generated/utility.cxx | |
parent | 3954be70024fd60c20c658f08025eff7654a8943 (diff) |
Add tests for auto-generated test inputs/outputs
Diffstat (limited to 'tests/test/simple/generated/utility.cxx')
-rw-r--r-- | tests/test/simple/generated/utility.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test/simple/generated/utility.cxx b/tests/test/simple/generated/utility.cxx new file mode 100644 index 0000000..e2113bd --- /dev/null +++ b/tests/test/simple/generated/utility.cxx @@ -0,0 +1,28 @@ +// file : tests/test/simple/generated/utility.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include <iostream> +#include <fstream> + +using namespace std; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " <file>" << endl; + return 1; + } + + ifstream ifs (argv[1], ifstream::in | ifstream::binary | ifstream::ate); + + if (!ifs.is_open ()) + cerr << "unable to open " << argv[1] << endl; + + if (ifs.tellg () == 0) + cerr << argv[1] << " is empty" << endl; + + return 0; +} |