From a949c58ec25f7ee1caca620e64649ddb52dd7ad7 Mon Sep 17 00:00:00 2001 From: "Mike D. Lowis" Date: Mon, 23 Apr 2012 15:12:23 -0400 Subject: [PATCH] Added test file for an option parser --- tests/test_options.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tests/test_options.cpp diff --git a/tests/test_options.cpp b/tests/test_options.cpp new file mode 100644 index 0000000..4e6f686 --- /dev/null +++ b/tests/test_options.cpp @@ -0,0 +1,64 @@ +// Unit Test Framework Includes +#include "UnitTest++.h" + +// Supporting Includes +#include +#include "exception.h" +#include "ivisitor.h" + +// File To Test +#include "dlparser.h" + +using namespace UnitTest; + +//----------------------------------------------------------------------------- +// Option Parsing Implementation +//----------------------------------------------------------------------------- +void parse_options(int argc, char* argv[]) +{ + //int i; + //for(i = 0; i < argc; i++) + //{ + // int len = strlen( argv[i] ); + // if( (len >= 2) && (argv[0] == '-') && (argv[1] == '-') ) + // { + // // Parse name + // // if expecting param + // // consume the = + // // parse param + // // call callback + // // endif + // } + // else if( (len >= 1) && (argv[0] == '-') ) + // { + // // Parse name + // // if expecting param + // // parse param + // } + // else + // { + // } + //} +} + +//----------------------------------------------------------------------------- +// Helper Functions +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Begin Unit Tests +//----------------------------------------------------------------------------- +namespace { + //------------------------------------------------------------------------- + // Test Parsing of Data Type Literals + //------------------------------------------------------------------------- + TEST(Parse_An_Empty_Vector) + { + //char* options[] = { + // (char*) "asd", + // (char*) "-A", + // (char*) "--foo" + //}; + //parse_options(3,options); + } +} -- 2.52.0