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

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1748 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 1748.


Report 1748 Actions


    Problem Report Number 1748
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0531
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Window System Application Interface V2
    Certification Program The Open Brand certification program
    Test Suite VSW version 5.0.0
    Test Identification Xlib9/ptimg 2
    Problem Summary PG4W.00053 This IR claims that the window and image sizes may be different.
    Problem Text

    This test failure is the result of testcase problems.
    The first problem is because the size of the image produced and the size
    of the image received from window after XPutImage is different. The latter
    is bigger than the former. This causes a failure in function checkarea.
    The makeimg function used to make the image, the width
    of the image is I_STDWIDTH(100), the height of the image is I_STDHEIGHT(90).
    XPutImage puts a 100*90 pixels size image on the window. Function
    checkarea scratches a different size image, using the following code to
    get the image:

    im = XGetImage(disp, d, 0, 0, width, height, AllPlanes, ZPixmap);

    the "width" and "height" in the above code line is defined by:

    getsize(disp, d, &width, &height);

    getsize() calls XGetGeometry() to return width and height:

    XGetGeometry(disp, d, &root, &x, &y,
    widthp? widthp: &dummy,
    heightp? heightp: &dummy, &border, &depth);

    But XGetGeometry actually gets the size of a drawable window or pixmap,
    "d" here is the "w" in the original checkarea function call. The
    returned "width" and "height" from "getsize" are bigger than 100*90.


    A second problem is that two different GCs calls are done in this test case,
    only one GC call should be done. In test case 002, there is a line of code:

    gc = makegc(display, w);

    w is a window type parameter, gc is a GC type parameter, display is a Display
    type parameter. Later in function dset gc is set again, here is the code:

    gc = makegc(disp, d);

    This new "gc" is then used in the rest of the test instead of the original gc.

    An additional problem is that the wrong parameters are passed to the fourth
    checkarea function call, here is the code:

    if (checkarea(display, w, &area, W_FG, W_FG, CHECK_ALL) == False ) {

    In this situation, the foreground and background of the Display "display" are
    both W_BG through XSetState in makegc and XSetForeground in dset, the image
    pixel value is 1 before the XPutImage call , so we should expect get an image
    from display whose pixel value is W_BG instead of W_FG. The above line code
    should be changed to:

    if (checkarea(display, w, &area, W_BG, W_BG, CHECK_ALL) == False ) {

    It also be noted that the test case is sensative to the value of pixel 0
    and pixel 1. On some implementations pixel 0 is black and pixel 1 is white.
    On other implementations this is reversed. The test case needs to take this
    into account.

    Proposed changes to Test.c, checkarea.c, dset.c and xtlibproto.h are
    below using the diff command:


    $ diff Test.c Test.c.org
    1124d1123
    <
    1153d1151
    <
    1168,1169c1166
    < /* dset(display, w, W_FG); */
    < dset(display, gc, w, W_FG);
    ---
    > dset(display, w, W_FG);
    1171d1167
    <
    1174c1170
    < startcall(display); /* set up the error handler */
    ---
    > startcall(display); /* set up the error handler */
    1186d1181
    <
    1196,1197c1191
    < /* dset(display, w, W_BG); */
    < dset(display, gc, w, W_BG);
    ---
    > dset(display, w, W_BG);
    1222a1217
    >
    1224,1225c1219
    < /* dset(display, w, W_FG); */
    < dset(display, gc, w, W_FG);
    ---
    > dset(display, w, W_FG);
    1241d1234
    <
    1250,1251c1243
    < /* dset(display, w, W_BG); */
    < dset(display, gc, w, W_BG) ;
    ---
    > dset(display, w, W_BG);
    1266,1270c1258
    <
    < /* if (checkarea(display, w, &area, W_FG, W_FG, CHECK_ALL) == False) {
    < */
    <
    < if (checkarea(display, w, &area, W_BG, W_BG, CHECK_ALL) == False) {
    ---
    > if (checkarea(display, w, &area, W_FG, W_FG, CHECK_ALL) == False) {
    $


    /************************************ End of "diff Test.c Test.c.org" *******/


    $ diff dset.c dset.c.org
    94c94
    < /*
    ---
    >
    105c105
    < gc = makegc(disp, d);
    ---
    > gc = makegc(disp, d);
    108,110c108,110
    < XFillRectangle(disp, d, gc, 0, 0, width+1, height+1);*/
    < /* XFreeGC(disp, gc); */
    < /*
    ---
    > XFillRectangle(disp, d, gc, 0, 0, width+1, height+1);
    > */ /* XFreeGC(disp, gc); */
    >
    112,131d111
    < */
    <
    < void
    < dset(disp,gc1, d1, pix)
    < Display *disp;
    < GC gc1;
    < Drawable d1;
    < unsigned long pix;
    < {
    < unsigned int width, height;
    <
    < getsize(disp, d1, &width, &height);
    < printf("In dset.c width and height are %d, %d \n", width, height );
    < XSetForeground(disp, gc1, pix);
    < /* XFillRectangle(disp, d1, gc1, 0, 0, 101, 91); */
    < XFillRectangle(disp, d1, gc1, 0, 0, I_STDWIDTH+1, I_STDHEIGHT+1);
    < /* XFillRectangle(disp, d1, gc1, 0, 0, width+1, height+1); */
    <
    < }
    <
    $

    /********************************** End of "diff dset.c dset.c.org" ********/

    $ diff checkarea.c checkarea.c.org
    116a117
    >
    131,132c132
    < /* im = XGetImage(disp, d, 0, 0, 100, 90, AllPlanes, ZPixmap); */
    < im = XGetImage(disp, d, 0, 0, I_STDWIDTH, I_STDHEIGHT, AllPlanes, XPixmap);
    ---
    > im = XGetImage(disp, d, 0, 0, width, height, AllPlanes, ZPixmap);
    151c151
    < /* for (y = yorig; y < yorig+height; y++) {
    ---
    > for (y = yorig; y < yorig+height; y++) {
    153,157d152
    < */
    < /* for (y = yorig; y < yorig+90; y++){
    < for (x = xorig; x < xorig+100; x++){ */
    < for (y = yorig; y < yorig+I_STDHEIGHT; y++){
    < for (x = xorig; x < xorig+I_STDWIDTH; x++){
    162c157
    < if (!(flags & CHECK_DIFFER)){
    ---
    > if (!(flags & CHECK_DIFFER))
    164d158
    < }
    170c164
    < if (!(flags & CHECK_DIFFER)){
    ---
    > if (!(flags & CHECK_DIFFER))
    172d165
    < }
    $

    /************************* End of "diff checkarea.c checkarea.c.org" ******/


    $ diff xtlibproto.h xtlibproto.h.org
    134,135c134
    < /* void dset(Display *disp, Drawable d, unsigned long pix); */
    < void dset(Display *disp, GC gc, Drawable d, unsigned long pix);
    ---
    > void dset(Display *disp, Drawable d, unsigned long pix);
    $

    /*********************** End of "diff xtlibproto.h xtlibproto.h.org" ******/


    Test Output

    TEST CASE: XPutImage

    TEST PURPOSE #2
    Assertion XPutImage-2.(C)
    When the image format is XYBitmap, then the foreground
    pixel in gc defines the source for the one bits in the
    image, and the background pixel defines the source for the
    zero bits.
    METH: Create depth 1 image in XYBitmap format.
    METH: Create drawable.
    METH: Set all bits in image to zero.
    METH: Set every pixel in drawable to W_FG.
    METH: Call XPutImage.
    METH: Verify results.
    METH: Set every pixel in drawable to W_BG.
    METH: Call XPutImage.
    METH: Verify results.
    METH: Set all bits in image to one.
    METH: Set every pixel in drawable to W_FG.
    METH: Call XPutImage.
    METH: Verify results.
    METH: Set every pixel in drawable to W_BG.
    METH: Call XPutImage.
    METH: Verify results.
    METH: Repeat for each visual.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0000.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0001.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0002.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0003.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0004.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0005.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0006.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0007.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0008.err for details
    REPORT: Area was not properly put.
    REPORT: Pixel mismatch in image
    REPORT: See file Err0009.err for details
    REPORT: Area was not properly put.
    2 FAIL


    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We recommend this request be refused.

    We believe the test is correct. We find no basis for the window sizes
    being different between XPutImage and what is received from the window.
    As shown below, all of the window sizes are accounted for. The test
    does the following:

    image = makeimg() calls
    XCreateImage() with
    I_STDWIDTH, I_STDHEIGHT, W_BG (100,90,0 from xtest.h)
    dsetimg() is called to set W_BG=0 explicitly.

    w = makewin() calls
    makewinpos() calls
    XCreateWindow() with
    W_STDWIDTH, W_STDHEIGHT (100,90 from xtest.h)
    getgc() sets foreground,background to W_FG,W_BG

    dsetimg() image to 0=W_BG
    dset() window foreground to W_FG=1
    XPutImage image W_BG -> display
    checkarea() #1 with W_BG, W_BG

    dset() window foreground to W_BG=0
    XPugImage image W_BG -> display
    checkarea() #2 with W_BG, W_BG


    dsetimg() image to 1=W_FG
    dset() window foreground to 1=W_FG
    XPutImage image W_FG -> display
    checkarea() #3 with W_FG, W_FG

    dset() window W_BG=0
    XPutImage image W_FG -> display
    checkarea() #4 with W_FG, W_FG

    The checkarea() function should be returning the same height and width
    because makewin() creates a window of the same 100x90 size as defined by
    the constants in xtest.h.

    Based on the sequence of events, 4th checkarea() is correct. The image
    is set to W_FG=1, and the display is set to W_BG=0. After the XPutImage,
    checkarea() correctly expects W_FG=1.

    The test case is not sensitive to the value of pixel 0 and 1 which are
    defined to be W_BG nd W_FG respectively in xtest.h The color of the pixels
    does not matter. It is the value (0 or 1) that matters.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority