VirtualBox

Changeset 63258 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Aug 10, 2016 12:23:00 PM (8 years ago)
Author:
vboxsync
Message:

Main: warnings

Location:
trunk/src/VBox/Main/testcase
Files:
4 edited

Legend:

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

    r63161 r63258  
    5151    uint32_t    uMapElements;
    5252    int         iResult;
    53 } aTestBlock[] =
     53} g_aTestBlock[] =
    5454{
    5555    /*
     
    103103    /** Overall result when done parsing. */
    104104    int         iResult;
    105 } aTestStream[] =
     105} g_aTestStream[] =
    106106{
    107107    /* No blocks. */
     
    125125        uint32_t    uMapElements;
    126126        int         iResult;
    127     } aTest[] =
     127    } s_aTest[] =
    128128    {
    129129        { "test5=test5\0t51=t51",           sizeof("test5=test5\0t51=t51"),                            0,  sizeof("test5=test5\0") - 1,                   1, VERR_MORE_DATA },
     
    131131    };
    132132
    133     for (unsigned iTest = 0; iTest < RT_ELEMENTS(aTest); iTest++)
     133    for (unsigned iTest = 0; iTest < RT_ELEMENTS(s_aTest); iTest++)
    134134    {
    135135        RTTestIPrintf(RTTESTLVL_DEBUG, "Manual test #%d\n", iTest);
    136136
    137137        GuestProcessStream stream;
    138         rc = stream.AddData((BYTE*)aTest[iTest].pbData, aTest[iTest].cbData);
     138        rc = stream.AddData((BYTE*)s_aTest[iTest].pbData, s_aTest[iTest].cbData);
    139139
    140140        for (;;)
     
    189189
    190190    unsigned iTest;
    191     for (iTest = 0; iTest < RT_ELEMENTS(aTestBlock); iTest++)
     191    for (iTest = 0; iTest < RT_ELEMENTS(g_aTestBlock); iTest++)
    192192    {
    193193        RTTestIPrintf(RTTESTLVL_DEBUG, "=> Test #%u\n", iTest);
    194194
    195195        GuestProcessStream stream;
    196         int iResult = stream.AddData((BYTE*)aTestBlock[iTest].pbData, aTestBlock[iTest].cbData);
     196        int iResult = stream.AddData((BYTE*)g_aTestBlock[iTest].pbData, g_aTestBlock[iTest].cbData);
    197197        if (RT_SUCCESS(iResult))
    198198        {
    199199            GuestProcessStreamBlock curBlock;
    200200            iResult = stream.ParseBlock(curBlock);
    201             if (iResult != aTestBlock[iTest].iResult)
     201            if (iResult != g_aTestBlock[iTest].iResult)
    202202            {
    203203                RTTestFailed(hTest, "\tReturned %Rrc, expected %Rrc\n",
    204                              iResult, aTestBlock[iTest].iResult);
    205             }
    206             else if (stream.GetOffset() != aTestBlock[iTest].uOffsetAfter)
     204                             iResult, g_aTestBlock[iTest].iResult);
     205            }
     206            else if (stream.GetOffset() != g_aTestBlock[iTest].uOffsetAfter)
    207207            {
    208208                RTTestFailed(hTest, "\tOffset %zu wrong, expected %u\n",
    209                              stream.GetOffset(), aTestBlock[iTest].uOffsetAfter);
     209                             stream.GetOffset(), g_aTestBlock[iTest].uOffsetAfter);
    210210            }
    211211            else if (iResult == VERR_MORE_DATA)
     
    217217                   || iResult == VERR_MORE_DATA))
    218218            {
    219                 if (curBlock.GetCount() != aTestBlock[iTest].uMapElements)
     219                if (curBlock.GetCount() != g_aTestBlock[iTest].uMapElements)
    220220                {
    221221                    RTTestFailed(hTest, "\tMap has %u elements, expected %u\n",
    222                                  curBlock.GetCount(), aTestBlock[iTest].uMapElements);
     222                                 curBlock.GetCount(), g_aTestBlock[iTest].uMapElements);
    223223                }
    224224            }
     
    226226            /* There is remaining data left in the buffer (which needs to be merged
    227227             * with a following buffer) -- print it. */
    228             size_t uOffset = stream.GetOffset();
    229             size_t uToWrite = aTestBlock[iTest].cbData - uOffset;
    230             if (uToWrite)
    231             {
    232                 const char *pszRemaining = aTestBlock[iTest].pbData;
    233                 RTTestIPrintf(RTTESTLVL_DEBUG, "\tRemaining (%u):\n", uToWrite);
     228            size_t off = stream.GetOffset();
     229            size_t cbToWrite = g_aTestBlock[iTest].cbData - off;
     230            if (cbToWrite)
     231            {
     232                RTTestIPrintf(RTTESTLVL_DEBUG, "\tRemaining (%u):\n", cbToWrite);
    234233
    235234                /* How to properly get the current RTTESTLVL (aka IPRT_TEST_MAX_LEVEL) here?
    236235                 * Hack alert: Using RTEnvGet for now. */
    237236                if (!RTStrICmp(RTEnvGet("IPRT_TEST_MAX_LEVEL"), "debug"))
    238                     RTStrmWriteEx(g_pStdOut, &aTestBlock[iTest].pbData[uOffset], uToWrite - 1, NULL);
     237                    RTStrmWriteEx(g_pStdOut, &g_aTestBlock[iTest].pbData[off], cbToWrite - 1, NULL);
    239238            }
    240239        }
     
    243242    RTTestIPrintf(RTTESTLVL_INFO, "Doing block tests ...\n");
    244243
    245     for (iTest = 0; iTest < RT_ELEMENTS(aTestStream); iTest++)
     244    for (iTest = 0; iTest < RT_ELEMENTS(g_aTestStream); iTest++)
    246245    {
    247246        RTTestIPrintf(RTTESTLVL_DEBUG, "=> Block test #%u\n", iTest);
    248247
    249248        GuestProcessStream stream;
    250         int iResult = stream.AddData((BYTE*)aTestStream[iTest].pbData, aTestStream[iTest].cbData);
     249        int iResult = stream.AddData((BYTE*)g_aTestStream[iTest].pbData, g_aTestStream[iTest].cbData);
    251250        if (RT_SUCCESS(iResult))
    252251        {
     
    268267            } while (RT_SUCCESS(iResult));
    269268
    270             if (iResult != aTestStream[iTest].iResult)
     269            if (iResult != g_aTestStream[iTest].iResult)
    271270            {
    272271                RTTestFailed(hTest, "\tReturned %Rrc, expected %Rrc\n",
    273                              iResult, aTestStream[iTest].iResult);
    274             }
    275             else if (uNumBlocks != aTestStream[iTest].uNumBlocks)
     272                             iResult, g_aTestStream[iTest].iResult);
     273            }
     274            else if (uNumBlocks != g_aTestStream[iTest].uNumBlocks)
    276275            {
    277276                RTTestFailed(hTest, "\tReturned %u blocks, expected %u\n",
    278                              uNumBlocks, aTestStream[iTest].uNumBlocks);
     277                             uNumBlocks, g_aTestStream[iTest].uNumBlocks);
    279278            }
    280279        }
  • trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp

    r62485 r63258  
    354354
    355355
    356 int main(int argc, char **argv)
     356int main()
    357357{
    358358    /*
  • trunk/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp

    r60924 r63258  
    196196
    197197
    198 int main(int argc, char **argv)
     198int main()
    199199{
    200200    /*
  • trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp

    r63177 r63258  
    337337static int tstClean(IVirtualBox *pVBox, IVirtualBoxClient *pClient)
    338338{
     339    NOREF(pClient);
    339340    HRESULT rc = S_OK;
    340341
     
    380381
    381382
    382 static DECLCALLBACK(int) tstThreadRun(RTTHREAD thread, void *pvUser)
    383 {
     383static DECLCALLBACK(int) tstThreadRun(RTTHREAD hThreadSelf, void *pvUser)
     384{
     385    RT_NOREF(hThreadSelf);
    384386    TestThreadArgs* args = (TestThreadArgs*)pvUser;
    385387    Assert(args != NULL);
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