Changeset 97275 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Oct 24, 2022 10:00:13 AM (2 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/testcase/Makefile.kmk
r97272 r97275 40 40 # without #ifdef modifications to the core code! 41 41 # 42 PROGRAMS.linux += tstClipboardMockHGCM43 42 tstClipboardMockHGCM_TEMPLATE = VBOXR3TSTEXE 44 43 tstClipboardMockHGCM_DEFS = VBOX_WITH_HGCM VBOX_WITH_SHARED_CLIPBOARD … … 51 50 tstClipboardMockHGCM_LIBS = $(LIB_RUNTIME) 52 51 53 if1of ($(KBUILD_TARGET), linux) 54 tstClipboardMockHGCM_SOURCES.linux += \ 52 if1of ($(KBUILD_TARGET), linux solaris) 53 PROGRAMS += tstClipboardMockHGCM 54 tstClipboardMockHGCM_SOURCES += \ 55 55 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp \ 56 56 ../VBoxSharedClipboardSvc-x11.cpp 57 tstClipboardMockHGCM_LIBPATH = \57 tstClipboardMockHGCM_LIBPATH = \ 58 58 $(VBOX_LIBPATH_X11) 59 tstClipboardMockHGCM_LIBS += \59 tstClipboardMockHGCM_LIBS += \ 60 60 Xt \ 61 61 X11 62 62 endif 63 if1of ($(KBUILD_TARGET), win) 64 PROGRAMS += tstClipboardMockHGCM 65 tstClipboardMockHGCM_SOURCES += \ 66 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp \ 67 ../VBoxSharedClipboardSvc-win.cpp 68 endif 63 69 64 tstClipboardMockHGCM_SOURCES.darwin += ../VBoxSharedClipboardSvc-darwin.cpp 65 tstClipboardMockHGCM_SOURCES.win += ../VBoxSharedClipboardSvc-win.cpp 66 67 tstClipboardMockHGCM_CLEAN = $(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run 70 tstClipboardMockHGCM_CLEAN = $(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run 68 71 69 72 if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS) -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardMockHGCM.cpp
r97274 r97275 369 369 * Test: Guest reading from host * 370 370 ********************************************************************************************************************************/ 371 #if defined (RT_OS_LINUX)371 #if defined (RT_OS_LINUX) || defined (RT_OS_SOLARIS) 372 372 /* Called from SHCLX11 thread. */ 373 373 static DECLCALLBACK(int) tstTestReadFromHost_ReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t fFormats, void *pvUser) … … 402 402 return VINF_SUCCESS; 403 403 } 404 #endif /* RT_OS_LINUX*/404 #endif /* (RT_OS_LINUX) || defined (RT_OS_SOLARIS) */ 405 405 406 406 typedef struct TSTUSERMOCK … … 475 475 * It in turn returns VINF_BUFFER_OVERFLOW when the supplied buffer was too small. */ 476 476 477 uint32_t cbChunk = RTRandU32Ex(1, pTask->cbData / cChunkedReads);477 uint32_t cbChunk = RTRandU32Ex(1, (uint32_t)(pTask->cbData / cChunkedReads)); 478 478 uint32_t cbRead = 0; 479 479 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Guest trying to read %RU32 bytes\n", cbChunk); … … 493 493 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Reading full data (%zu)\n", pTask->cbData); 494 494 uint32_t cbRead = 0; 495 int vrc2 = VbglR3ClipboardReadData(pCmdCtx->idClient, pTask->enmFmtGst, pabDst, cbDst, &cbRead);495 int vrc2 = VbglR3ClipboardReadData(pCmdCtx->idClient, pTask->enmFmtGst, pabDst, (uint32_t)cbDst, &cbRead); 496 496 RTTEST_CHECK_MSG(g_hTest, vrc2 == VINF_SUCCESS, (g_hTest, "Got %Rrc, expected VINF_SUCCESS\n", vrc2)); 497 497 RTTEST_CHECK_MSG(g_hTest, cbRead == cbToRead, (g_hTest, "Read %RU32 bytes, expected %zu\n", cbRead, cbToRead)); … … 554 554 RT_NOREF(ppvCtx); 555 555 556 #if defined (RT_OS_LINUX) || defined (RT_OS_SOLARIS) 556 557 /* Initialize the Shared Clipboard backend callbacks. */ 557 558 PSHCLBACKEND pBackend = ShClSvcGetBackend(); … … 562 563 ShClCallbacks.pfnOnClipboardRead = tstTestReadFromHost_OnClipboardReadCallback; 563 564 ShClBackendSetCallbacks(pBackend, &ShClCallbacks); 565 #endif /* defined (RT_OS_LINUX) || defined (RT_OS_SOLARIS) */ 564 566 565 567 /* Set the right clipboard mode, so that the guest can read from the host. */ … … 583 585 pTask->cbData++; /* Add terminating zero. */ 584 586 #else 585 pTask->pvData = tstGenerateUtf16StringA( pTask->cbData / sizeof(RTUTF16));587 pTask->pvData = tstGenerateUtf16StringA((uint32_t)(pTask->cbData / sizeof(RTUTF16))); 586 588 pTask->cbData += sizeof(RTUTF16); /* Add terminating zero. */ 587 589 #endif
Note:
See TracChangeset
for help on using the changeset viewer.