- Timestamp:
- Dec 6, 2019 10:33:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r81820 r82447 127 127 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 128 128 129 static void testMsgAddOld(PSHCLCLIENT pClient, uint32_t uMsg, uint32_t uParm1) 130 { 131 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(uMsg, 2 /* cParms */); /* The old protocol (v0) has a fixed parameter count of 2. */ 132 RTTESTI_CHECK_RETV(pMsg != NULL); 133 134 HGCMSvcSetU32(&pMsg->paParms[0], uMsg); 135 HGCMSvcSetU32(&pMsg->paParms[1], uParm1); 136 137 int rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 138 RTTESTI_CHECK_RC_OK(rc); 139 rc = shClSvcClientWakeup(pClient); 129 /* Adds a host data read request message to the client's message queue. */ 130 static void testMsgAddReadData(PSHCLCLIENT pClient, uint32_t uFormat) 131 { 132 SHCLDATAREQ dataReq; 133 RT_ZERO(dataReq); 134 135 dataReq.uFmt = uFormat; 136 137 int rc = ShClSvcDataReadRequest(pClient, &dataReq, NULL /* puEvent */); 140 138 RTTESTI_CHECK_RC_OK(rc); 141 139 } … … 167 165 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD, 2, parms, 0); 168 166 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This should get updated only when the guest call completes. */ 169 testMsgAdd Old(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_UNICODETEXT);167 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_UNICODETEXT); 170 168 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 171 169 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_UNICODETEXT); … … 177 175 RTTestISub("Testing one format, no waiting guest calls."); 178 176 shClSvcClientReset(&g_Client); 179 testMsgAdd Old(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_HTML);177 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_HTML); 180 178 HGCMSvcSetU32(&parms[0], 0); 181 179 HGCMSvcSetU32(&parms[1], 0); … … 196 194 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD, 2, parms, 0); 197 195 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This should get updated only when the guest call completes. */ 198 testMsgAdd Old(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML);196 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML); 199 197 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 200 198 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_UNICODETEXT); … … 211 209 RTTestISub("Testing two formats, no waiting guest calls."); 212 210 shClSvcClientReset(&g_Client); 213 testMsgAdd Old(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML);211 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML); 214 212 HGCMSvcSetU32(&parms[0], 0); 215 213 HGCMSvcSetU32(&parms[1], 0); … … 316 314 int ShClSvcImplReadData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; } 317 315 int ShClSvcImplWriteData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, PSHCLDATABLOCK) { AssertFailed(); return VINF_SUCCESS; } 318 int ShClSvcImplSync(PSHCLCLIENT) { AssertFailed(); return VERR_WRONG_ORDER; }316 int ShClSvcImplSync(PSHCLCLIENT) { return VINF_SUCCESS; } 319 317 320 318 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
Note:
See TracChangeset
for help on using the changeset viewer.