VirtualBox

Changeset 103522 in vbox for trunk/src/VBox/Storage


Ignore:
Timestamp:
Feb 22, 2024 11:15:20 AM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161865
Message:

Storage/testcase: Some unused variable fixes, bugref:3409

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/VDScript.cpp

    r99739 r103522  
    650650
    651651                vdScriptTokenizerSkipCh(pTokenizer);
    652                 fOpFound = true;
    653652                break;
    654653            }
     
    15771576                break;
    15781577
     1578            if (RT_FAILURE(rc))
     1579                break;
     1580
    15791581            pExprNew->BinaryOp.pLeftExpr = pExpr;
    15801582            pExpr = pExprNew;
     
    16371639            }
    16381640            else
     1641                break;
     1642
     1643            if (RT_FAILURE(rc))
    16391644                break;
    16401645
     
    17191724                break;
    17201725
     1726            if (RT_FAILURE(rc))
     1727                break;
     1728
    17211729            pExprNew->BinaryOp.pLeftExpr = pExpr;
    17221730            pExpr = pExprNew;
     
    17791787            }
    17801788            else
     1789                break;
     1790
     1791            if (RT_FAILURE(rc))
    17811792                break;
    17821793
     
    21952206            }
    21962207            else
     2208                break;
     2209
     2210            if (RT_SUCCESS(rc))
    21972211                break;
    21982212
  • trunk/src/VBox/Storage/testcase/tstVDIo.cpp

    r103005 r103522  
    15561556                                if (RT_SUCCESS(rc))
    15571557                                {
     1558#ifdef RT_STRICT
    15581559                                    pEvtDesc = RTTraceLogRdrEvtGetDesc(hEvt);
    15591560                                    AssertMsg(!RTStrCmp(pEvtDesc->pszId, "Complete"),
    15601561                                              ("Expected a completion event but got: %s\n", pEvtDesc->pszId));
     1562#endif
    15611563                                }
    15621564                            }
     
    16171619
    16181620        if (RT_SUCCESS(rc))
    1619             rc = VDIoRndCreate(&pGlob->pIoRnd, cbPattern, uSeed);
     1621            rc = VDIoRndCreate(&pGlob->pIoRnd, cbPattern, uSeedToUse);
    16201622    }
    16211623
     
    17711773        RTPrintf("Dumping memory file %s to %s, this might take some time\n", pcszFile, pcszPathToDump);
    17721774        rc = VDIoBackendDumpToFile(pIt->pIoStorage, pcszPathToDump);
    1773         rc = VERR_NOT_IMPLEMENTED;
    17741775    }
    17751776    else
     
    24832484           && cSectorsLeft)
    24842485    {
    2485         uint32_t cThisSectors = VDIoRndGetU32Ex(pIoTest->pIoRnd, 1, (uint32_t)cSectorsLeft / 2);
     2486        size_t cThisSectors = VDIoRndGetU32Ex(pIoTest->pIoRnd, 1, (uint32_t)cSectorsLeft / 2);
    24862487        size_t cbThisBuf = cThisSectors * 512;
    24872488
     
    28472848                }
    28482849                else
     2850                {
    28492851                    rc = VDScriptCtxCallFn(hScriptCtx, "main", NULL, 0);
     2852                    if (RT_FAILURE(rc))
     2853                        RTPrintf("Executing the script failed rc=%Rrc\n", rc);
     2854                }
     2855
    28502856                VDScriptCtxDestroy(hScriptCtx);
    28512857            }
  • trunk/src/VBox/Storage/testcase/tstVDSnap.cpp

    r98103 r103522  
    260260    /* Create the virtual disk test data */
    261261    pbTestPattern = (uint8_t *)RTMemAlloc(pTest->cbTestPattern);
     262    if (!pbTestPattern)
     263    {
     264        RTPrintf("Failed to allocate memory for test pattern\n");
     265        g_cErrors++;
     266        return VERR_NO_MEMORY;
     267    }
    262268
    263269    RTRandAdvBytes(g_hRand, pbTestPattern, pTest->cbTestPattern);
     
    409415
    410416    VDDestroy(pVD);
    411     if (paDiskSeg)
    412         RTMemFree(paDiskSeg);
    413     if (pbTestPattern)
    414         RTMemFree(pbTestPattern);
     417    RTMemFree(paDiskSeg);
     418    RTMemFree(pbTestPattern);
    415419
    416420    RTFileDelete(pTest->pcszBaseImage);
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r103005 r103522  
    826826    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
    827827    AssertReturn(uOffset >= pFS->off, VERR_INVALID_PARAMETER);
    828     int rc;
    829828
    830829    /* Write the data to the buffer, flushing as required. */
     
    835834        while (uOffset > pFS->offBuffer + sizeof(pFS->abBuffer) - 1)
    836835        {
    837             rc = RTFileWrite(pFS->file, &pFS->abBuffer[0],
    838                              sizeof(pFS->abBuffer), NULL);
     836            int rc = RTFileWrite(pFS->file, &pFS->abBuffer[0],
     837                                 sizeof(pFS->abBuffer), NULL);
     838            if (RT_FAILURE(rc))
     839                return rc;
     840
    839841            RT_ZERO(pFS->abBuffer);
    840842            pFS->offBuffer += sizeof(pFS->abBuffer);
     
    966968    if (RT_SUCCESS(rc))
    967969        pFS->cb = cbSize;
    968     return VINF_SUCCESS;
     970    return rc;
    969971}
    970972
     
    989991    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
    990992    AssertReturn(uOffset >= pFS->off, VERR_INVALID_PARAMETER);
    991     int rc;
    992993
    993994    /* Write the data to the buffer, flushing as required. */
     
    9991000        {
    10001001            if (!ASMMemIsZero(pFS->abBuffer, sizeof(pFS->abBuffer)))
    1001                 rc = RTFileWriteAt(pFS->file, pFS->offBuffer,
    1002                                    &pFS->abBuffer[0],
    1003                                    sizeof(pFS->abBuffer), NULL);
     1002            {
     1003                int rc = RTFileWriteAt(pFS->file, pFS->offBuffer,
     1004                                       &pFS->abBuffer[0],
     1005                                       sizeof(pFS->abBuffer), NULL);
     1006                if (RT_FAILURE(rc))
     1007                    return rc;
     1008            }
    10041009            RT_ZERO(pFS->abBuffer);
    10051010            pFS->offBuffer += sizeof(pFS->abBuffer);
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