VirtualBox

Ignore:
Timestamp:
Jul 9, 2009 11:58:45 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49824
Message:

GuestHost/SharedClipboard: test for correct update notifications about available X11 targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp

    r21430 r21434  
    423423                                 size_t cTargets)
    424424{
    425     bool changed = true;
     425    bool changed = false;
    426426
    427427    Log3 (("%s: called\n", __PRETTY_FUNCTION__));
     
    433433        clipReportFormatsToVBox(pCtx);
    434434}
     435
     436#ifdef TESTCASE
     437static bool clipTestTargetUpdate(CLIPBACKEND *pCtx)
     438{
     439    bool success = true;
     440    bool changed = true;
     441    clipGetFormatsFromTargets(pCtx, NULL, 0, &changed);
     442    clipGetFormatsFromTargets(pCtx, NULL, 0, &changed);  /* twice */
     443    if (changed)
     444        success = false;
     445    Atom targets[3];
     446    targets[0] = clipGetAtom(NULL, "COMPOUND_TEXT");
     447    targets[1] = clipGetAtom(NULL, "text/plain");
     448    targets[2] = clipGetAtom(NULL, "TARGETS");
     449    clipGetFormatsFromTargets(pCtx, targets, RT_ELEMENTS(targets), &changed);
     450    if (!changed)
     451        success = false;
     452    clipGetFormatsFromTargets(pCtx, targets, RT_ELEMENTS(targets), &changed);
     453    if (changed)
     454        success = false;
     455    return success;
     456}
     457#endif
    435458
    436459/**
     
    14791502         * arrive. */
    14801503        clipReportFormatsToVBox(pCtx);
    1481     else
    1482         clipReportEmptyX11CB(pCtx);
     1504    // else
     1505    //     clipReportEmptyX11CB(pCtx);
    14831506    LogFlowFunc(("rc=%Rrc\n", rc));
    14841507}
     
    24122435
    24132436    /*** X11 text format conversion ***/
    2414     RTPrintf(TEST_NAME ": TESTING selection of X11 text formats\n");
     2437    RTPrintf(TEST_NAME ": TESTING handling of X11 selection targets\n");
    24152438    if (!clipTestTextFormatConversion(pCtx))
    24162439    {
    24172440        RTPrintf(TEST_NAME ": Failed to select the right X11 text formats\n");
     2441        ++cErrs;
     2442    }
     2443    if (!clipTestTargetUpdate(pCtx))
     2444    {
     2445        RTPrintf(TEST_NAME ": Incorrect reporting of new selection targets\n");
    24182446        ++cErrs;
    24192447    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette