Report 0015 Actions
Problem Report Number |
0015 |
Submitter's Classification |
Test Suite problem |
State |
Resolved |
Resolution |
Rejected (REJ) |
Problem Resolution ID |
REJ.PX.0009 |
Raised |
2004-04-16 03:25 |
Updated |
2004-04-19 18:57 |
Published |
2004-04-19 18:57 |
Product Standard |
1003.1-2003 System Interfaces |
Certification Program |
POSIX Certified by IEEE and The Open Group |
Test Suite |
VSX-PCTS2003 version 1.0A |
Test Identification |
/tset/XPG4.os/genuts/getopt/T.getopt 1 Failed |
Problem Summary |
The test set information table for the getopt test contains many errors |
Problem Text |
The table used to set up the getopt 1 test contains incorrect values,
causing a correctly operating getopt to fail. The table also does not
match the table printed in the testing strategy section of the report. |
Test Output |
**********************************************************************
/tset/XPG4.os/genuts/getopt/T.getopt 1 Failed
Test Description:
When the variable opterr is not set to zero and a call to
getopt() is
made with optind and the arguments argc, argv, and the option
string
optstring as per the table below, then getopt() outputs the
corresponding information, if any, to standard error and
returns the
value and sets the variables optind, optarg, and optopt as
specified
in the corresponding columns of the table.
optstring Set of optind optarg Return stderr
optopt
Arguments In Out
'' --fred 1 2 Unset -1 No O/P
Unset
'' -a fred 1 2 Unset ? Diagnostic a
'' -a fred 2 2 Unset -1 No O/P
Unset
: --fred 1 2 Unset -1 No O/P
Unset
: -a fred 1 2 Unset ? No O/P a
: -a fred 2 2 Unset -1 No O/P
Unset
abcd -a -c fred 1 2 Unset a No O/P
Unset
abcd -a -c fred 2 3 Unset c No O/P
Unset
abcd -a -c fred 3 3 Unset -1 No O/P
Unset
abcd -ac fred 1 1 Unset a No O/P
Unset
abcd -ac fred N/C 2 Unset c No O/P
Unset
abcd -ac fred 2 2 Unset -1 No O/P
Unset
abcd -z fred 1 2 Unset ? Diagnostic z
abcd -a -- -b 1 2 Unset a No O/P
Unset
abcd -a -- -b 2 3 Unset -1 No O/P
Unset
abcd -a -c fred 1 2 Unset a No O/P
Unset
abcd -a -c fred 2 3 Unset c No O/P
Unset
abcd -a -c fred 3 3 Unset -1 No O/P
Unset
:abcd -z fred 1 2 Unset ? No O/P z
ab:cd:e -a -d opt fred 1 2 Unset a No O/P
Unset
ab:cd:e -a -d opt fred 2 4 opt d No O/P
Unset
ab:cd:e -a -d opt 2 4 opt d No O/P
Unset
ab:cd:e -a -dopt fred 2 3 opt d No O/P
Unset
ab:cd:e -a -dopt 2 3 opt d No O/P
Unset
ab:cd:e -a -d opt fred 4 4 Unset -1 No O/P
Unset
ab:cd:e -a -d 2 3 Unset ? Diagnostic d
ab:cd:e -d -a fred 1 3 -a d No O/P
Unset
ab:cd:e -d-a fred 1 2 -a d No O/P
Unset
ab:cd:e -a opt -d opt2 1 2 Unset a No O/P
Unset
ab:cd:e -a opt -d opt2 2 2 Unset -1 No O/P
Unset
ab:cd:e -abd fred 1 1 Unset a No O/P
Unset
ab:cd:e -abd fred N/C 2 d b No O/P
Unset
ab:cd:e -abd 1 1 Unset a No O/P
Unset
ab:cd:e -abd N/C 2 d b No O/P
Unset
ab:cd:e -ab opt fred 1 1 Unset a No O/P
Unset
ab:cd:e -ab opt fred N/C 3 opt b No O/P
Unset
ab:cd:e -ab opt 1 1 Unset a No O/P
Unset
ab:cd:e -ab opt N/C 3 opt b No O/P
Unset
ab:cd:e -ab 1 1 Unset a No O/P
Unset
ab:cd:e -ab N/C 2 Unset ? Diagnostic b
ab:cd:e -b opt -- fred 1 3 opt b No O/P
Unset
ab:cd:e -b opt -- fred 3 4 Unset -1 No O/P
Unset
ab:cd:e -b -- -c fred 1 3 -- b No O/P
Unset
ab:cd:e -b -- -c fred 3 4 Unset c No O/P
Unset
ab:cd:e -b '' -c fred 1 3 Null b No O/P
Unset
ab:cd:e -b '' -c fred 3 4 Unset c No O/P
Unset
ab:cd:e -b 'o1 o2' fred 1 3 o1 o2 b No O/P
Unset
ab:cd:e '-bo1 o2' fred 1 2 o1 o2 b No O/P
Unset
ab:cd:e '-b o1 o2' fred 1 2 ' o1 o2' b No O/P
Unset
:ab:cd:e -a -d opt fred 2 4 opt d No O/P
Unset
:ab:cd:e -a -d opt 2 4 opt d No O/P
Unset
:ab:cd:e -a -d opt fred 4 4 Unset -1 No O/P
Unset
:ab:cd:e -a -d 2 3 NULL : No O/P d
:ab:cd:e -ab 1 1 Unset a No O/P
Unset
:ab:cd:e -ab N/C 2 NULL : No O/P b
ab: -: -a fred 1 2 Unset ? Diagnostic :
:ab: -: -a fred 1 2 Unset : No O/P
Unset
Test Strategy:
PARENT process will
CREATE [child process|process pair]
CHILD process will
REDIRECT standard error to file
CALL getopt(targc, targv, optstring)
VERIFY that the return value, diagnostics, and variables
optind,
optarg and optopt are as expected
Test Information:
getopt() failed when called with :-
optstring : [ab:cd:e]
arguments : [-a] [-d]
optind : [2]
getopt() failed on the following :-
optind : expected [4], actual [3]
getopt() failed when called with :-
optstring : [ab:cd:e]
arguments : [-ab]
optind : [1]
getopt() failed on the following :-
optind : expected [3], actual [2]
getopt() failed when called with :-
optstring : [:ab:cd:e]
arguments : [-a] [-d]
optind : [2]
getopt() failed on the following :-
optind : expected [4], actual [3]
optarg : expected [(null)], actual [opt]
getopt() failed when called with :-
optstring : [:ab:cd:e]
arguments : [-ab]
optind : [1]
getopt() failed on the following :-
optind : expected [3], actual [2]
|
Review Information
Review Type |
TSMA Review |
Start Date |
2004-04-16 03:25 |
Last Updated |
2004-04-16 18:21 |
Completed |
2004-04-16 18:21 |
Status |
Complete |
Review Recommendation |
Rejected (REJ) |
Review Response |
The getopt() results expected by the test are all actually required by
the specification. However, the reports of incorrect optind values
relate to a very common deviation from the specification for which the
test normally gives a Warning result only.
The reason this test has reported a Failure instead of a Warning is the
incorrect optarg value in the line
"optarg : expected [(null)], actual [opt]"
This part of the test is for a missing option argument. The
specification states the required behaviour as follows:
"If the option takes an argument, getopt() shall set the variable optarg
to point to the option-argument as follows:
1. If the option was the last character in the string pointed to by an
element of argv, then optarg shall contain the next element of argv, and
optind shall be incremented by 2. If the resulting value of optind is
greater than argc, this indicates a missing option-argument, and
getopt() shall return an error indication."
It clearly states that optarg must contain the "next element of argv",
which in this case is the terminating NULL entry in argv. This
implementation has not updated optarg as required - it still has the
value from before the getopt() call. |
Review Type |
SA Review |
Start Date |
2004-04-16 17:21 |
Last Updated |
2004-04-17 02:49 |
Completed |
2004-04-17 02:49 |
Status |
Complete |
Review Resolution |
Rejected (REJ) |
Review Conclusion |
The SA does not find the case for a TSD sufficient as per the TSMA
statement |
Problem Reporting System Options:
|