Changeset 81449 in vbox for trunk/src/VBox/HostServices/SharedClipboard/testcase
- Timestamp:
- Oct 22, 2019 1:03:29 PM (5 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/testcase/Makefile.kmk
r81439 r81449 32 32 33 33 if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS) 34 tstClipboardServiceHost_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 35 tstClipboardServiceHost_SOURCES += \ 36 ../VBoxSharedClipboardSvc-transfers.cpp \ 37 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp \ 38 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardArea.cpp 39 endif 40 41 if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS) 34 42 PROGRAMS += tstClipboardTransfers 35 43 tstClipboardTransfers_TEMPLATE = VBOXR3TSTEXE 36 tstClipboardTransfers_DEFS = VBOX_WITH_ SHARED_CLIPBOARD_TRANSFERS44 tstClipboardTransfers_DEFS = VBOX_WITH_HGCM UNIT_TEST VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 37 45 tstClipboardTransfers_SOURCES = \ 38 46 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \ -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r81448 r81449 59 59 int rc; 60 60 61 RTTestISub("Testing HOST_FN_SET_MODE");61 RTTestISub("Testing VBOX_SHCL_HOST_FN_SET_MODE"); 62 62 rc = setupTable(&table); 63 63 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); … … 94 94 table.pfnUnload(NULL); 95 95 } 96 97 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 98 static void testSetTransferMode(void) 99 { 100 struct VBOXHGCMSVCPARM parms[2]; 101 VBOXHGCMSVCFNTABLE table; 102 103 RTTestISub("Testing VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE"); 104 int rc = setupTable(&table); 105 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); 106 107 /* Invalid parameter. */ 108 HGCMSvcSetU64(&parms[0], 99); 109 rc = table.pfnHostCall(NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 110 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 111 112 /* Invalid mode. */ 113 HGCMSvcSetU32(&parms[0], 99); 114 rc = table.pfnHostCall(NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 115 RTTESTI_CHECK_RC(rc, VERR_INVALID_FLAGS); 116 117 /* Enable transfers. */ 118 HGCMSvcSetU32(&parms[0], VBOX_SHCL_TRANSFER_MODE_ENABLED); 119 rc = table.pfnHostCall(NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 120 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 121 122 /* Disable transfers again. */ 123 HGCMSvcSetU32(&parms[0], VBOX_SHCL_TRANSFER_MODE_DISABLED); 124 rc = table.pfnHostCall(NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 125 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 126 } 127 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 96 128 97 129 static void testMsgAddOld(PSHCLCLIENT pClient, uint32_t uMsg, uint32_t uParm1) … … 244 276 { 245 277 testSetMode(); 278 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 279 testSetTransferMode(); 280 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 246 281 testSetHeadless(); 247 282 } … … 276 311 int ShClSvcImplInit() { return VINF_SUCCESS; } 277 312 void ShClSvcImplDestroy() { } 278 int ShClSvcImplDisconnect(PSHCLCLIENT) 279 { return VINF_SUCCESS; }280 int ShClSvcImpl Connect(PSHCLCLIENT, bool)281 { return VINF_SUCCESS; }282 int ShClSvcImpl FormatAnnounce(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLFORMATDATA)283 { AssertFailed(); return VINF_SUCCESS; }284 int ShClSvcImplReadData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK, unsigned int *) 285 { AssertFailed(); return VERR_WRONG_ORDER; } 286 int ShClSvcImpl WriteData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK)287 { AssertFailed();return VINF_SUCCESS; }288 int ShClSvcImpl Sync(PSHCLCLIENT)289 { AssertFailed(); return VERR_WRONG_ORDER; } 290 313 int ShClSvcImplDisconnect(PSHCLCLIENT) { return VINF_SUCCESS; } 314 int ShClSvcImplConnect(PSHCLCLIENT, bool) { return VINF_SUCCESS; } 315 int ShClSvcImplFormatAnnounce(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLFORMATDATA) { AssertFailed(); return VINF_SUCCESS; } 316 int ShClSvcImplReadData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; } 317 int ShClSvcImplWriteData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK) { AssertFailed(); return VINF_SUCCESS; } 318 int ShClSvcImplSync(PSHCLCLIENT) { AssertFailed(); return VERR_WRONG_ORDER; } 319 320 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 321 int ShClSvcImplTransferCreate(PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 322 int ShClSvcImplTransferDestroy(PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 323 int ShClSvcImplTransferGetRoots(PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 324 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 325
Note:
See TracChangeset
for help on using the changeset viewer.