- Timestamp:
- Oct 1, 2020 7:47:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/testcase/tstUsbMouse.cpp
r82968 r86399 140 140 pUsbIns->pHlpR3 = &g_tstUsbHlp; 141 141 pUsbIns->pvInstanceDataR3 = pUsbIns->achInstanceData; 142 pUsbIns->pCfg = pCfg; 142 143 rc = g_UsbHidMou.pfnConstruct(pUsbIns, iInstance, pCfg, NULL); 143 144 if (RT_SUCCESS(rc)) … … 156 157 157 158 159 static void tstMouseDestruct(RTTEST hTest, PPDMUSBINS pUsbIns) 160 { 161 if (pUsbIns) 162 { 163 g_UsbHidMou.pfnDestruct(pUsbIns); 164 CFGMR3DestroyTree(pUsbIns->pCfg); 165 RTTestGuardedFree(hTest, pUsbIns); 166 } 167 } 168 169 158 170 static void testConstructAndDestruct(RTTEST hTest) 159 171 { … … 165 177 PPDMUSBINS pUsbIns = NULL; 166 178 RTTEST_CHECK_RC(hTest, tstMouseConstruct(hTest, 0, "relative", 1, &pUsbIns), VINF_SUCCESS); 167 if (pUsbIns) 168 { 169 g_UsbHidMou.pfnDestruct(pUsbIns); 170 RTTestGuardedFree(hTest, pUsbIns); 171 } 179 tstMouseDestruct(hTest, pUsbIns); 172 180 173 181 /* … … 205 213 RTTEST_CHECK_RC(hTest, tstMouseConstruct(hTest, 0, "relative", 1, &pUsbIns, s_aVersionTests[i].uInsVersion), 206 214 s_aVersionTests[i].rc); 207 if (pUsbIns) 208 RTTestGuardedFree(hTest, pUsbIns); 215 tstMouseDestruct(hTest, pUsbIns); 209 216 } 210 217 RTAssertSetMayPanic(fSavedMayPanic); … … 253 260 } 254 261 RTTEST_CHECK_RC_OK(hTest, rc); 255 if (pUsbIns) 256 { 257 g_UsbHidMou.pfnDestruct(pUsbIns); 258 RTTestGuardedFree(hTest, pUsbIns); 259 } 262 tstMouseDestruct(hTest, pUsbIns); 260 263 } 261 264 … … 269 272 RT_ZERO(Urb); 270 273 if (RT_SUCCESS(rc)) 271 {272 274 rc = g_UsbHidMou.pfnUsbReset(pUsbIns, false); 273 }274 275 if (RT_SUCCESS(rc)) 275 276 { 276 277 if (g_drvTstMouse.pDrv) 277 g_drvTstMouse.pDrv->pfnPutEventAbs(g_drvTstMouse.pDrv, 300, 200, 1, 278 3, 3); 278 g_drvTstMouse.pDrv->pfnPutEventAbs(g_drvTstMouse.pDrv, 300, 200, 1, 3, 3); 279 279 else 280 280 rc = VERR_PDM_MISSING_INTERFACE; … … 306 306 } 307 307 RTTEST_CHECK_RC_OK(hTest, rc); 308 if (pUsbIns) 309 { 310 g_UsbHidMou.pfnDestruct(pUsbIns); 311 RTTestGuardedFree(hTest, pUsbIns); 312 } 308 tstMouseDestruct(hTest, pUsbIns); 313 309 } 314 310 … … 360 356 } 361 357 RTTEST_CHECK_RC_OK(hTest, rc); 362 if (pUsbIns) 363 { 364 g_UsbHidMou.pfnDestruct(pUsbIns); 365 RTTestGuardedFree(hTest, pUsbIns); 366 } 358 tstMouseDestruct(hTest, pUsbIns); 367 359 } 368 360 #endif
Note:
See TracChangeset
for help on using the changeset viewer.