summaryrefslogtreecommitdiff
path: root/tests/Get_Opt_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-08-30 03:18:12 +0000
committerSteve Huston <shuston@riverace.com>2002-08-30 03:18:12 +0000
commit7c24d3a6aa5f1b77790f79746d31a70b5d42667c (patch)
tree87f77c3ee9381444d183ff443024058dbcb4271c /tests/Get_Opt_Test.cpp
parentbfad8c46ea09fc50a063eb65ecea5f552148a00b (diff)
downloadATCD-7c24d3a6aa5f1b77790f79746d31a70b5d42667c.tar.gz
ChangeLogTag:Thu Aug 29 15:18:31 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'tests/Get_Opt_Test.cpp')
-rw-r--r--tests/Get_Opt_Test.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/Get_Opt_Test.cpp b/tests/Get_Opt_Test.cpp
index 0b170905a22..0488f464df1 100644
--- a/tests/Get_Opt_Test.cpp
+++ b/tests/Get_Opt_Test.cpp
@@ -30,15 +30,19 @@ ACE_RCSID(tests, Get_Opt_Test, "$Id$")
* It returns 0 for success and 1 for error so we can keep track of the
* total error count.
*/
+
+static const ACE_TString empty (ACE_TEXT (""));
+
static int
parse_args (int test_number,
int ordering,
const ACE_TCHAR *test_args,
int skip_argv0 = 1,
- int report_errors = 1)
+ int report_errors = 1,
+ const ACE_TString &opt_prefix = empty)
{
ACE_TString test;
- ACE_TString optstring;
+ ACE_TString optstring (opt_prefix);
// Test the skip_argv0 for the first test only.
if (skip_argv0 > 0)
@@ -165,6 +169,11 @@ parse_args (int test_number,
break;
case ':':
// This means an option requiring an argument didn't have one.
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT (" Option '%c' requires an argument but ")
+ ACE_TEXT ("none was supplied\n"),
+ get_opt.opt_opt ()));
+ break;
case '?':
// An unrecognized option.
default:
@@ -272,7 +281,8 @@ run_test (int& test_number, int ordering)
retval += parse_args (test_number++, ordering, ACE_TEXT ("-X"), 1, report_errors);
// Short option with missing required arg.
- retval += parse_args (test_number++, ordering, ACE_TEXT ("-r"), 1, report_errors);
+ ACE_TString report_missing (ACE_TEXT (":"));
+ retval += parse_args (test_number++, ordering, ACE_TEXT ("-r"), 1, report_errors, report_missing);
// Short option with missing required arg with trailing "--".
// This reads "--" as the arg, but should it?