HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1556 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 1556.


Report 1556 Actions


    Problem Report Number 1556
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0838
    Raised 2001-02-06 08:00
    Updated 2003-03-13 08:00
    Published 2001-02-12 08:00
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.1.1
    Test Identification CAPI.os/xcurses/bkgrnd 4
    Problem Summary TSD4U.00299 The test may fail because it does not ensure that the string passed to mvwadd_wchstr() is null-terminated
    Problem Text
    The following code is part of tset/CAPI.os/xcurses/bkgrnd/bkgrnd.c:

    static void test4A(void)
    {
    .....
    wchar_t wch[64];
    cchar_t wchstr[64];

    .....
    memset(wch, 0, sizeof(wch));
    for (i = 0; i < strlen(string_1); i++) {
    errno = 0;
    memset(wch, 0, sizeof(wch));
    ret_val = mbstowcs((wchar_t *)wch, &string_1[i], 1);
    if (ret_val == -1) {
    uwerrno("mbstowcs");
    return;
    }
    s2 = setcchar(&wchstr[i], wch, WA_DIM, 48, (void *)0);
    if (s2 == ERR) {
    curout(TET_UNRESOLVED, "setcchar", s2);
    return;
    }
    }
    tet_infoline("TEST: Write some text at (1,2) with attributes (DIM, COLOR_PAIR(48))");
    s2 = mvwadd_wchstr(stdscr, 1, 2, wchstr);
    .....
    }

    The above code is making the cchar_t string 'wchstr' converting
    the string 'string_1' to the wide-char string 'wch' and calling
    the function setcchar(). And the made cchar_t string 'wchstr'
    is passed to the mvwadd_wchstr() function.

    But, the the cchar_t string 'wchstr' has not been terminated by null
    before being passed to mvwadd_wchstr(). The function mvwadd_wchstr()
    expects the cchar_t string is null-terminated, according to
    the XCurses spec (add_wchnstr(), page 37, X/Open Curses, Issue 4, Version2).
    Therefore, the result of the above code will be undetermined.

    Either the cchar_t string 'wchstr' needs to be null-terminated before being
    passed to mvwadd_wchstr() or the cchar_t string array needs to be
    initialized to 0 before the for-loop.
    Test Output
    ************************************************************************
    /tset/CAPI.os/xcurses/Mbkgrnd/T.bkgrnd 4 Failed

    Test Description:
    Base Required Conformance
    A call to int bkgrnd(const cchar_t *wch) shall turn off the previous
    background attributes, logical OR the requested attributes into the
    window rendition, and set the background property of the window stdscr
    based on the information in wch.

    Test Information:
    PREP: Set test locale: xcurses
    PREP: Set environment variables and open terminal connection
    PREP: Call newterm
    PREP: Initialize color pairs
    TEST: Write some text at (0,2)
    TEST: Write some text at (1,2) with attributes (DIM, COLOR_PAIR(48))
    TEST: Set background to '~' with attributes (BOLD|REVERSE,
    COLOR_PAIR(15))
    TEST: Data on terminal screen matches expected data
    ERROR: Line 1 is not as expected. Expected line is:
    ~~Should~also~get~window~rendition~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~
    ERROR: Actual line is:
    ~~Should~also~get~window~renditioq~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~
    ERROR: Foreground color at (r=1, c=33) should be Black(0), is Green(2)
    ERROR: Background color at (r=1, c=33) should be Cyan(6), is Black(0)
    ERROR: Dim attribute should be on at (r=1, c=33), is off
    Expected data:
    $TET_EXECUTE/tset/CAPI.os/xcurses/data/BKGRND/data4.scrn.
    Actual data:
    $TET_EXECUTE/tset/CAPI.os/xcurses/tmp/BKGRND/data4.scrn
    CLEANUP: Call endwin
    CLEANUP: Call delscreen
    CLEANUP: Restore environment variables and close terminal connection

    ************************************************************************

    ************************************************************************
    /tset/CAPI.os/xcurses/bkgrnd/T.bkgrnd 4 Failed

    Test Description:
    Base Required Conformance
    A call to int bkgrnd(const cchar_t *wch) shall turn off the previous
    background attributes, logical OR the requested attributes into the
    window rendition, and set the background property of the window stdscr
    based on the information in wch.

    Test Information:
    PREP: Set test locale: xcurses
    PREP: Set environment variables and open terminal connection
    PREP: Call newterm
    PREP: Initialize color pairs
    TEST: Write some text at (0,2)
    TEST: Write some text at (1,2) with attributes (DIM, COLOR_PAIR(48))
    TEST: Set background to '~' with attributes (BOLD|REVERSE,
    COLOR_PAIR(15))
    TEST: Data on terminal screen matches expected data
    ERROR: Line 1 is not as expected. Expected line is:
    ~~Should~also~get~window~rendition~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~
    ERROR: Actual line is:
    ~~Should~also~get~window~renditioq~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~
    ERROR: Foreground color at (r=1, c=33) should be Black(0), is Green(2)
    ERROR: Background color at (r=1, c=33) should be Cyan(6), is Black(0)
    ERROR: Dim attribute should be on at (r=1, c=33), is off
    Expected data:
    $TET_EXECUTE/tset/CAPI.os/xcurses/data/BKGRND/data4.scrn.
    Actual data:
    $TET_EXECUTE/tset/CAPI.os/xcurses/tmp/BKGRND/data4.scrn
    CLEANUP: Call endwin
    CLEANUP: Call delscreen
    CLEANUP: Restore environment variables and close terminal connection

    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    This is accepted as a fault in the test suite.

    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:

     

    Back   


Contact the Certification Authority