Changeset 60383 in vbox for trunk/src/VBox
- Timestamp:
- Apr 7, 2016 11:15:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp
r60170 r60383 80 80 81 81 82 #define CHECK_ERROR_L(iface, method) \ 83 do { \ 84 rc = iface->method; \ 85 if (FAILED(rc)) \ 86 RTPrintf("warning: %s->%s failed on line %u with hrc=%Rhrc\n", #iface, #method, __LINE__, rc);\ 87 } while (0) 88 89 82 90 /** Macro that executes the given expression and report any failure. 83 91 * The expression must return a HRESULT. */ … … 100 108 if (SUCCEEDED(rc) && !progress.isNull()) 101 109 { 102 CHECK_ERROR (progress, WaitForCompletion(-1));110 CHECK_ERROR_L(progress, WaitForCompletion(-1)); 103 111 if (SUCCEEDED(rc)) 104 112 { 105 113 BOOL completed = true; 106 CHECK_ERROR (progress, COMGETTER(Completed)(&completed));114 CHECK_ERROR_L(progress, COMGETTER(Completed)(&completed)); 107 115 if (SUCCEEDED(rc)) 108 116 { 109 117 Assert(completed); 110 118 LONG iRc; 111 CHECK_ERROR (progress, COMGETTER(ResultCode)(&iRc));119 CHECK_ERROR_L(progress, COMGETTER(ResultCode)(&iRc)); 112 120 if (SUCCEEDED(rc)) 113 121 { … … 115 123 { 116 124 ProgressErrorInfo info(progress); 117 RTPrintf("Start VM '%ls' failed. Error: %ls.\n", machineName.raw(), info.getText().raw());125 RTPrintf("Start VM '%ls' failed. Warning: %ls.\n", machineName.raw(), info.getText().raw()); 118 126 } 119 127 else … … 158 166 { 159 167 //RTPrintf("Stopping VM %ls...\n", machineName.raw()); 160 CHECK_ERROR (progress, WaitForCompletion(-1));168 CHECK_ERROR_L(progress, WaitForCompletion(-1)); 161 169 if (SUCCEEDED(rc)) 162 170 { 163 171 BOOL completed = true; 164 CHECK_ERROR (progress, COMGETTER(Completed)(&completed));172 CHECK_ERROR_L(progress, COMGETTER(Completed)(&completed)); 165 173 if (SUCCEEDED(rc)) 166 174 { 167 175 //ASSERT(completed); 168 176 LONG iRc; 169 CHECK_ERROR (progress, COMGETTER(ResultCode)(&iRc));177 CHECK_ERROR_L(progress, COMGETTER(ResultCode)(&iRc)); 170 178 if (SUCCEEDED(rc)) 171 179 { … … 173 181 { 174 182 ProgressErrorInfo info(progress); 175 RTPrintf("Stop VM %ls failed. Error: %ls.\n", machineName.raw(), info.getText().raw());183 RTPrintf("Stop VM %ls failed. Warning: %ls.\n", machineName.raw(), info.getText().raw()); 176 184 rc = iRc; 177 185 } … … 215 223 Bstr bstrId; 216 224 Bstr machineName; 217 CHECK_ERROR (machines[idx], COMGETTER(Id)(bstrId.asOutParam()));225 CHECK_ERROR_L(machines[idx], COMGETTER(Id)(bstrId.asOutParam())); 218 226 if (SUCCEEDED(rc)) 219 CHECK_ERROR (machines[idx], COMGETTER(Name)(machineName.asOutParam()));227 CHECK_ERROR_L(machines[idx], COMGETTER(Name)(machineName.asOutParam())); 220 228 if (SUCCEEDED(rc)) 221 229 { … … 305 313 Bstr machineName(tstMakeMachineName(i)); 306 314 /* Default VM settings */ 307 CHECK_ERROR (pVBox, CreateMachine(NULL, /* Settings */315 CHECK_ERROR_L(pVBox, CreateMachine(NULL, /* Settings */ 308 316 machineName.raw(), /* Name */ 309 317 ComSafeArrayAsInParam(groups), /* Groups */ … … 313 321 if (SUCCEEDED(rc)) 314 322 { 315 CHECK_ERROR (pVBox, RegisterMachine(ptrMachine));323 CHECK_ERROR_L(pVBox, RegisterMachine(ptrMachine)); 316 324 RTPrintf("Machine '%ls' created\n", machineName.raw()); 317 325 } … … 340 348 341 349 /* Delete created VM and its files */ 342 CHECK_ERROR (pVBox, FindMachine(machineName.raw(), machine.asOutParam()));350 CHECK_ERROR_L(pVBox, FindMachine(machineName.raw(), machine.asOutParam())); 343 351 344 352 // try to stop it again if it was not stopped 345 353 if (SUCCEEDED(rc)) 346 CHECK_ERROR (machine, COMGETTER(State)(&machineState));354 CHECK_ERROR_L(machine, COMGETTER(State)(&machineState)); 347 355 if (machineState == MachineState_Running 348 356 || machineState == MachineState_Paused) … … 354 362 355 363 if (SUCCEEDED(rc)) 356 CHECK_ERROR (machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(media)));357 if (SUCCEEDED(rc)) 358 CHECK_ERROR (machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam()));359 if (SUCCEEDED(rc)) 360 CHECK_ERROR (progress, WaitForCompletion(-1));364 CHECK_ERROR_L(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(media))); 365 if (SUCCEEDED(rc)) 366 CHECK_ERROR_L(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam())); 367 if (SUCCEEDED(rc)) 368 CHECK_ERROR_L(progress, WaitForCompletion(-1)); 361 369 if (SUCCEEDED(rc)) 362 370 RTPrintf("Machine '%ls' deleted.\n", machineName.raw()); … … 504 512 RTTestBanner(g_hTest); 505 513 514 #ifndef RT_ARCH_AMD64 515 /* 516 * Seems linux x86 machines has 4GB memory limit. 517 * So this test cannot be run here, just to skip the test. 518 */ 519 RTTestPassed(g_hTest, "Warning: the test can be processed on x64 machine only.\n"); 520 return RTTestSummaryAndDestroy(g_hTest); 521 #endif 522 506 523 RTPrintf("Initializing ...\n"); 507 524 int rc = RTSemEventCreate(&g_PingEevent);
Note:
See TracChangeset
for help on using the changeset viewer.