Changeset 47273 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 19, 2013 5:39:38 PM (11 years ago)
- Location:
- trunk/src/VBox/Main/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/Makefile.kmk
r47266 r47273 227 227 $(dir $(VBOX_XML_SCHEMADEFS_H)) 228 228 tstMouseImpl_LIBS = $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) 229 # Super ugly hack to make the code work well enough without having ATL/COM 230 # completely initialized, without it there are crashes caused by ComObjPtr 231 # and many other pieces of glue code, as the inproc code path is more picky. 232 tstMouseImpl_DEFS.win += VBOX_COM_OUTOFPROC_MODULE 229 233 230 234 -
trunk/src/VBox/Main/testcase/tstMouseImpl.cpp
r47261 r47273 5 5 6 6 /* 7 * Copyright (C) 2011 Oracle Corporation7 * Copyright (C) 2011-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 138 138 static struct PDMDRVINS *ppdmdrvIns = NULL; 139 139 140 Mouse *pMouse;141 ConsoleMouseInterface *pConsole ;140 ComObjPtr<Mouse> pMouse; 141 ConsoleMouseInterface *pConsole = NULL; 142 142 143 143 static struct … … 204 204 VMMDevPort.pfnSetAbsoluteMouse = setAbsoluteMouse; 205 205 VMMDevPort.pfnUpdateMouseCapabilities = updateMouseCapabilities; 206 pMouse = new Mouse; 207 Assert(SUCCEEDED(pMouse->FinalConstruct())); 206 HRESULT hrc = pMouse.createInstance(); 207 AssertComRC(hrc); 208 if (FAILED(hrc)) 209 return VERR_GENERAL_FAILURE; 208 210 pConsole = new TestConsole; 209 211 pMouse->init(pConsole); … … 217 219 static void teardown(void) 218 220 { 219 delete pMouse; 220 delete pConsole; 221 RTMemFree(ppdmdrvIns); 221 pMouse.setNull(); 222 if (pConsole) 223 delete pConsole; 224 if (ppdmdrvIns) 225 RTMemFree(ppdmdrvIns); 222 226 } 223 227 … … 351 355 for (unsigned i = 0; g_tests[i]; ++i) 352 356 { 353 AssertRC(setup()); 354 g_tests[i](hTest); 357 int rc = setup(); 358 AssertRC(rc); 359 if (RT_SUCCESS(rc)) 360 g_tests[i](hTest); 355 361 teardown(); 356 362 }
Note:
See TracChangeset
for help on using the changeset viewer.