VirtualBox

Changeset 60383 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 7, 2016 11:15:08 PM (9 years ago)
Author:
vboxsync
Message:

vbox/main/testcase: ​bugref:6173: document maximum VM limit... skip test work on x86 computer due to OOM. Changed non important errors to warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp

    r60170 r60383  
    8080
    8181
     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
    8290/** Macro that executes the given expression and report any failure.
    8391 *  The expression must return a HRESULT. */
     
    100108    if (SUCCEEDED(rc) && !progress.isNull())
    101109    {
    102         CHECK_ERROR(progress, WaitForCompletion(-1));
     110        CHECK_ERROR_L(progress, WaitForCompletion(-1));
    103111        if (SUCCEEDED(rc))
    104112        {
    105113            BOOL completed = true;
    106             CHECK_ERROR(progress, COMGETTER(Completed)(&completed));
     114            CHECK_ERROR_L(progress, COMGETTER(Completed)(&completed));
    107115            if (SUCCEEDED(rc))
    108116            {
    109117                Assert(completed);
    110118                LONG iRc;
    111                 CHECK_ERROR(progress, COMGETTER(ResultCode)(&iRc));
     119                CHECK_ERROR_L(progress, COMGETTER(ResultCode)(&iRc));
    112120                if (SUCCEEDED(rc))
    113121                {
     
    115123                    {
    116124                        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());
    118126                    }
    119127                    else
     
    158166        {
    159167            //RTPrintf("Stopping VM %ls...\n", machineName.raw());
    160             CHECK_ERROR(progress, WaitForCompletion(-1));
     168            CHECK_ERROR_L(progress, WaitForCompletion(-1));
    161169            if (SUCCEEDED(rc))
    162170            {
    163171                BOOL completed = true;
    164                 CHECK_ERROR(progress, COMGETTER(Completed)(&completed));
     172                CHECK_ERROR_L(progress, COMGETTER(Completed)(&completed));
    165173                if (SUCCEEDED(rc))
    166174                {
    167175                    //ASSERT(completed);
    168176                    LONG iRc;
    169                     CHECK_ERROR(progress, COMGETTER(ResultCode)(&iRc));
     177                    CHECK_ERROR_L(progress, COMGETTER(ResultCode)(&iRc));
    170178                    if (SUCCEEDED(rc))
    171179                    {
     
    173181                        {
    174182                            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());
    176184                            rc = iRc;
    177185                        }
     
    215223            Bstr bstrId;
    216224            Bstr machineName;
    217             CHECK_ERROR(machines[idx], COMGETTER(Id)(bstrId.asOutParam()));
     225            CHECK_ERROR_L(machines[idx], COMGETTER(Id)(bstrId.asOutParam()));
    218226            if (SUCCEEDED(rc))
    219                 CHECK_ERROR(machines[idx], COMGETTER(Name)(machineName.asOutParam()));
     227                CHECK_ERROR_L(machines[idx], COMGETTER(Name)(machineName.asOutParam()));
    220228            if (SUCCEEDED(rc))
    221229            {
     
    305313        Bstr machineName(tstMakeMachineName(i));
    306314        /* Default VM settings */
    307         CHECK_ERROR(pVBox, CreateMachine(NULL,                          /* Settings */
     315        CHECK_ERROR_L(pVBox, CreateMachine(NULL,                          /* Settings */
    308316                                         machineName.raw(),             /* Name */
    309317                                         ComSafeArrayAsInParam(groups), /* Groups */
     
    313321        if (SUCCEEDED(rc))
    314322        {
    315             CHECK_ERROR(pVBox, RegisterMachine(ptrMachine));
     323            CHECK_ERROR_L(pVBox, RegisterMachine(ptrMachine));
    316324            RTPrintf("Machine '%ls' created\n", machineName.raw());
    317325        }
     
    340348
    341349        /* 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()));
    343351
    344352        // try to stop it again if it was not stopped
    345353        if (SUCCEEDED(rc))
    346             CHECK_ERROR(machine, COMGETTER(State)(&machineState));
     354            CHECK_ERROR_L(machine, COMGETTER(State)(&machineState));
    347355        if (machineState == MachineState_Running
    348356            || machineState == MachineState_Paused)
     
    354362
    355363        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));
    361369        if (SUCCEEDED(rc))
    362370            RTPrintf("Machine '%ls' deleted.\n", machineName.raw());
     
    504512    RTTestBanner(g_hTest);
    505513
     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
    506523    RTPrintf("Initializing ...\n");
    507524    int rc = RTSemEventCreate(&g_PingEevent);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette