Changeset 94228 in vbox for trunk/src/VBox
- Timestamp:
- Mar 14, 2022 7:19:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardMockHGCM.cpp
r93969 r94228 16 16 */ 17 17 18 #include <VBox/GuestHost/HGCMMock.h>19 20 18 #include "../VBoxSharedClipboardSvc-internal.h" 21 19 … … 25 23 # include <VBox/GuestHost/SharedClipboard-x11.h> 26 24 #endif 25 26 #include <VBox/GuestHost/HGCMMock.h> 27 27 28 28 #include <iprt/assert.h> … … 39 39 * Static globals * 40 40 *********************************************************************************************************************************/ 41 42 41 static RTTEST g_hTest; 43 42 static SHCLCLIENT g_Client; … … 163 162 VBOXHGCMSVCPARM aParms[2]; 164 163 HGCMSvcSetU32(&aParms[0], uMode); 165 int rc2 = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, aParms);164 int rc2 = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, aParms); 166 165 RTTESTI_CHECK_MSG_RET(rc == rc2, ("Expected %Rrc, got %Rrc\n", rc, rc2), rc2); 167 166 uint32_t const uModeRet = ShClSvcGetMode(); … … 190 189 RTTestISub("Testing VBOX_SHCL_HOST_FN_SET_MODE"); 191 190 192 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();191 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 193 192 194 193 /* Reset global variable which doesn't reset itself. */ 195 194 HGCMSvcSetU32(&parms[0], VBOX_SHCL_MODE_OFF); 196 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, parms);195 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, parms); 197 196 RTTESTI_CHECK_RC_OK(rc); 198 197 u32Mode = ShClSvcGetMode(); 199 198 RTTESTI_CHECK_MSG(u32Mode == VBOX_SHCL_MODE_OFF, ("u32Mode=%u\n", (unsigned) u32Mode)); 200 199 201 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 0, parms);200 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 0, parms); 202 201 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 203 202 204 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 2, parms);203 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 2, parms); 205 204 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 206 205 207 206 HGCMSvcSetU64(&parms[0], 99); 208 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, parms);207 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_MODE, 1, parms); 209 208 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 210 209 … … 219 218 RTTestISub("Testing VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE"); 220 219 221 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();220 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 222 221 223 222 /* Invalid parameter. */ 224 223 VBOXHGCMSVCPARM parms[2]; 225 224 HGCMSvcSetU64(&parms[0], 99); 226 int rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms);225 int rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 227 226 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 228 227 229 228 /* Invalid mode. */ 230 229 HGCMSvcSetU32(&parms[0], 99); 231 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms);230 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 232 231 RTTESTI_CHECK_RC(rc, VERR_INVALID_FLAGS); 233 232 234 233 /* Enable transfers. */ 235 234 HGCMSvcSetU32(&parms[0], VBOX_SHCL_TRANSFER_MODE_ENABLED); 236 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms);235 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 237 236 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 238 237 239 238 /* Disable transfers again. */ 240 239 HGCMSvcSetU32(&parms[0], VBOX_SHCL_TRANSFER_MODE_DISABLED); 241 rc = tstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms);240 rc = TstHgcmMockSvcHostCall(pSvc, NULL, VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE, 1, parms); 242 241 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 243 242 } … … 249 248 RTTestISub("Setting up VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT test"); 250 249 251 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();250 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 252 251 253 252 VBOXHGCMSVCPARM parms[2]; … … 345 344 RTTestISub("Testing client (guest) API - Simple"); 346 345 347 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();346 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 348 347 349 348 /* Preparations. */ … … 523 522 RTTestISub("Testing HOST_FN_SET_HEADLESS"); 524 523 525 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();524 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 526 525 527 526 VBOXHGCMSVCPARM parms[2]; … … 839 838 pTask->cbChunk = pTask->cbData; 840 839 841 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();842 PTSTHGCMMOCKCLIENT pMockClient = tstHgcmMockSvcWaitForConnect(pSvc);843 RT_BREAKPOINT(); 840 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 841 PTSTHGCMMOCKCLIENT pMockClient = TstHgcmMockSvcWaitForConnect(pSvc); 842 844 843 AssertPtrReturn(pMockClient, VERR_INVALID_POINTER); 845 844 … … 963 962 RTAssertSetMayPanic(false); 964 963 965 PTSTHGCMMOCKSVC pSvc = tstHgcmMockSvcInst();966 967 tstHgcmMockSvcCreate(pSvc, sizeof(SHCLCLIENT));968 tstHgcmMockSvcStart(pSvc);964 PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst(); 965 966 TstHgcmMockSvcCreate(pSvc, sizeof(SHCLCLIENT)); 967 TstHgcmMockSvcStart(pSvc); 969 968 970 969 /* … … 985 984 tstTaskDestroy(&g_TstCtx.Task); 986 985 987 tstHgcmMockSvcStop(pSvc); 988 tstHgcmMockSvcDestroy(pSvc); 986 TstHgcmMockSvcStop(pSvc); 987 TstHgcmMockSvcDestroy(pSvc); 988 989 VBOXHGCMSVCFNTABLE fn; 990 VBoxHGCMSvcLoad(&fn); 989 991 990 992 /*
Note:
See TracChangeset
for help on using the changeset viewer.