/**************************************************** * Executable: Array_driver * Author: Douglas Wilhelm Harder * Copyright (c) 2014-5 by Douglas Wilhelm Harder. All rights reserved. * * DO NOT EDIT THIS FILE * * Create an instance of * Array_tester * Array_tester * Array_tester * Array_tester * as requested and calls the member function run(). * * The member function run() will interpret the * input appropriately and exit when the interpreter * receives either the command 'exit' or and * end-of-file. ****************************************************/ #include #include #include "Array_tester.h" int main( int argc, char *argv[] ) { if ( argc > 2 ) { std::cerr << "Expecting at most one command-line argument" << std::endl; return -1; } std::cout << "Starting Test Run" << std::endl; if ( argc == 1 || !std::strcmp( argv[1], "int" ) ) { if ( argc == 1 ) { std::cerr << "Expecting a command-line argument of either 'short', 'int', 'float' or 'double'," << std::endl << "but got none; using 'int' by default." << std::endl; } Array_tester tester; tester.run(); } else if ( !std::strcmp( argv[1], "short" ) ) { Array_tester tester; tester.run(); } else if ( !std::strcmp( argv[1], "double" ) ) { Array_tester tester; tester.run(); } else if ( !std::strcmp( argv[1], "float" ) ) { Array_tester tester; tester.run(); } else { std::cerr << "Expecting a command-line argument of either 'short', 'int', 'float' or 'double'," << std::endl << "but got '" << argv[1] << "'" << std::endl; } std::cout << "Finishing Test Run" << std::endl; return 0; }