From 277994e27c8036799a7ea599d00489bbe7608351 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 11 Sep 2020 15:56:04 +0100 Subject: [PATCH] Add missing test file --- tests/testdata/cpp/simple/.gitignore | 1 + tests/testdata/cpp/simple/printer.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/testdata/cpp/simple/printer.cpp diff --git a/tests/testdata/cpp/simple/.gitignore b/tests/testdata/cpp/simple/.gitignore index fec4c0b..d3a7590 100644 --- a/tests/testdata/cpp/simple/.gitignore +++ b/tests/testdata/cpp/simple/.gitignore @@ -1,3 +1,4 @@ simple variables struct +printer diff --git a/tests/testdata/cpp/simple/printer.cpp b/tests/testdata/cpp/simple/printer.cpp new file mode 100644 index 0000000..1e4a0b7 --- /dev/null +++ b/tests/testdata/cpp/simple/printer.cpp @@ -0,0 +1,21 @@ +#include +#include + +int main( int argc, char** argv ) +{ + if ( ( argc - 1 ) % 2 ) + { + std::cerr << "Unbalanced arguments\n"; + return 1; + } + + for ( int i=1; i < argc; i += 2 ) + { + std::cout << argv[ i ] + << ": " + << argv[ i + 1 ] + << '\n'; + } + + return 0; +}