From 36ec90018e1a6337d23fc5286ed926c2134bde1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Feb 2018 14:39:47 +0200 Subject: Add tests for auto-generated test inputs/outputs --- tests/test/simple/generated/utility.cxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/test/simple/generated/utility.cxx (limited to 'tests/test/simple/generated/utility.cxx') 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 +#include + +using namespace std; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " " << 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; +} -- cgit v1.1