Changeset 69629 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
- Timestamp:
- Nov 9, 2017 1:06:18 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
r69500 r69629 1959 1959 } 1960 1960 else 1961 { 1961 1962 rc = VERR_NOT_IMPLEMENTED; 1963 pCtx->fBusy = false; 1964 } 1962 1965 if (RT_FAILURE(rc)) 1963 1966 { … … 2553 2556 } 2554 2557 2558 static void testBadFormatRequestFromHost(RTTEST hTest, CLIPBACKEND *pCtx) 2559 { 2560 clipSetSelectionValues("UTF8_STRING", XA_STRING, "hello world", 2561 sizeof("hello world"), 8); 2562 clipSendTargetUpdate(pCtx); 2563 if (clipQueryFormats() != VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 2564 RTTestFailed(hTest, "Wrong targets reported: %02X\n", 2565 clipQueryFormats()); 2566 else 2567 { 2568 char *pc; 2569 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL; 2570 ClipRequestDataFromX11(pCtx, 100, pReq); /* Bad format. */ 2571 int rc = VINF_SUCCESS; 2572 uint32_t cbActual = 0; 2573 clipGetCompletedRequest(&rc, &pc, &cbActual, &pReqRet); 2574 if (rc != VERR_NOT_IMPLEMENTED) 2575 RTTestFailed(hTest, "Wrong return code, expected VERR_NOT_IMPLEMENTED, got %Rrc\n", 2576 rc); 2577 clipSetSelectionValues("", XA_STRING, "", sizeof(""), 8); 2578 clipSendTargetUpdate(pCtx); 2579 if (clipQueryFormats() == VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 2580 RTTestFailed(hTest, "Failed to report targets after bad host request.\n"); 2581 } 2582 } 2583 2555 2584 int main() 2556 2585 { … … 2756 2785 (hTest, "VBox grabbed the clipboard with unknown data and we ignored it\n")); 2757 2786 testStringFromVBoxFailed(hTest, pCtx, "UTF8_STRING"); 2787 2788 /*** VBox requests a bad format ***/ 2789 RTTestSub(hTest, "recovery from a bad format request"); 2790 testBadFormatRequestFromHost(hTest, pCtx); 2791 2758 2792 rc = ClipStopX11(pCtx); 2759 2793 AssertRCReturn(rc, 1);
Note:
See TracChangeset
for help on using the changeset viewer.