|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1296 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1296.
Report 1296 Actions
Problem Report Number 1296 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0578 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1998-07-13 08:00 Product Standard Internationalised Terminal Interfaces Certification Program The Open Brand certification program Test Suite VSU version 5.0.2 Test Identification xcurses/restartterm 1 Problem Summary TSD4U.00240 The implementation is returning -1 for an empty string capability. Problem Text
Here is the failing code fragment:
tet_infoline("TEST: String capabilities are initialized");
if (strcmp(tigetstr("sc"), "") != 0){
sprintf(ebuf, "ERROR: Expected save_cursor = \"\", is \"%s\"",
tigetstr("sc"));
The test is assuming that tigetstr("sc") will return a null string when
the terminal does not have the "sc" capability. But according to Curses
Interface, 4.2, p. 196, tigetstr() should return (char *)-1 here, as
our implementation does. strcmp() fails with a segmentation violation on
(char *)-1.
--
We disagree with the Consultant's Initial Response and appeal the
X/Open Final Response. Please reconsider this decision with the
following additional commentary.
The consultant made the following Initial Response:
We recommend this request be refused.
The specification says tigetstr will return (char *)-1 only if
capname is not a defined string capability, however sc is a
defined string capability in the specification. Thus the
implementation is non-conforming in indicating an error for it.
Rather, the capability is valid but simply empty here and thus
the test is correct as written in expecting an empty string as
the value for it. This is standard practice in order to allow
application portability across terminals with varied sets of
capabilities.
--
The submitters disagree. The RETURN VALUE section for tigetflag(),
tigetnum(), and tigetstr() says:
"Upon successful completion, tigetflag(), tigetnum() and
tigetstr() return the specified capability. The tigetflag()
function returns -1 if capname is not a boolean capability.
The tigetnum() function returns -2 if capname is not a numeric
capability. The tigetstr() function returns (char *)-1 if
capname is not a string capability."
One could argue that there is a gray area in the specification because
the last sentence could be interpreted as either "The tigetstr()
function returns (char *)-1 if capname is not the name of a string
capability name." (as the test suite is doing) or "The tigetstr()
function returns (char *)-1 if capname is not the name of a string
capability supported by the terminal." (as all implementations
familiar to the submitters do).
However, if we take the approach used by the test suite for tigetstr(),
similar logic would dictate that tigetflag() and tigetnum() would have
to make up a boolean value or a numeric value for boolean and numeric
capabilities that don't have entries in the terminfo database for a
particular terminal. For boolean capabilities not defined by the
terminfo database, applications need to know the difference between
capability not defined and TRUE or FALSE; the only way to do this is to
return -1 even if the capability name is known. Similarly, for numeric
capabilities, if -2 is only allowed to indicate invalid capability
name, then there is no way to guess at what return value from
tigetnum() means valid name, but no value assigned.
Given this, we believe the spec can only be interpreted one way, and
the test suite is not doing it that way.
We also note that other parts of the curses test suite assume that
tigetstr() behaves as we have implemented it. The following code comes
from test case 13 of /tset/CAPIutil/gterminfo/gterminfo13.c:
tet_infoline("TEST: Retrieve last capability in entry");
if ((pstr = tigetstr("sgr0")) == (char *)-1) {
tet_infoline("ERROR: tigetstr returned -1");
tet_result(TET_FAIL);
s2 = putenv(oldterminfo);
exit(0);
}
Here the test suite is correctly expecting tigetstr() to return (char *)-1
if the "sgr0" string capability is not defined for this terminal
even though the test suite knows that "sgr0" is a valid string
capability name.
Test Output
10|0 /tset/CAPIxcurses/frestartte/frestartte1 15:29:25|TC Start, scenario
ref 0-
1
15|0 1.10 13|TCM Start
400|0 1 1 15:29:26|IC Start
200|0 1 15:29:26|TP Start
520|0 1 19690 1 1|SPEC1170TESTSUITE CASE 1
520|0 1 19690 1 2|A call to TERMINAL *restartterm(char *term, int
520|0 1 19690 1 3|fildes, int *errret) shall read in the terminfo
520|0 1 19690 1 4|database and initialize the terminfo data structures.
520|0 1 19691 1 1|PREP: Set test locale: xcurses
520|0 1 19691 1 2|PREP: Set environment variables and open terminal
connection
520|0 1 19691 2 1|PREP: Call newterm
520|0 1 19691 2 2|PREP: Initialize color pairs
520|0 1 19691 2 3|TEST: Call restartterm with a different terminal
520|0 1 19691 2 4|TEST: Boolean capabilities are initialized
520|0 1 19691 2 5|TEST: Numeric capabilities are initialized
520|0 1 19691 2 6|TEST: String capabilities are initialized
520|0 1 19690 2 1|ERROR: TEST TERMINATED DUE TO SIGSEGV SIGNAL (11)
220|0 1 1 15:29:26|FAIL
410|0 1 1 15:29:26|IC End
Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We agree this is a test suite deficiency in the test
suite version(s) listed.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 1296
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority