VirtualBox

Changeset 77969 in vbox for trunk


Ignore:
Timestamp:
Apr 1, 2019 1:20:22 AM (6 years ago)
Author:
vboxsync
Message:

FsPerf: Skip block sizes that exceeds the file size. bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp

    r77968 r77969  
    27322732{
    27332733    RTTestISubF("IO - Sequential read %RU32", cbBlock);
    2734 
    2735     uint8_t *pbBuf = (uint8_t *)RTMemPageAlloc(cbBlock);
    2736     if (pbBuf)
    2737     {
    2738         memset(pbBuf, 0xf7, cbBlock);
    2739         PROFILE_IO_FN("RTFileRead", fsPerfIoReadWorker(hFile1, cbFile, cbBlock, pbBuf, &offActual, &cSeeks));
    2740         RTMemPageFree(pbBuf, cbBlock);
     2734    if (cbBlock <= cbFile)
     2735    {
     2736
     2737        uint8_t *pbBuf = (uint8_t *)RTMemPageAlloc(cbBlock);
     2738        if (pbBuf)
     2739        {
     2740            memset(pbBuf, 0xf7, cbBlock);
     2741            PROFILE_IO_FN("RTFileRead", fsPerfIoReadWorker(hFile1, cbFile, cbBlock, pbBuf, &offActual, &cSeeks));
     2742            RTMemPageFree(pbBuf, cbBlock);
     2743        }
     2744        else
     2745            RTTestSkipped(g_hTest, "insufficient (virtual) memory available");
    27412746    }
    27422747    else
    2743         RTTestSkipped(g_hTest, "insufficient (virtual) memory available");
     2748        RTTestSkipped(g_hTest, "test file too small");
    27442749}
    27452750
     
    31863191    RTTestISubF("IO - Sequential write %RU32", cbBlock);
    31873192
    3188     uint8_t *pbBuf = (uint8_t *)RTMemPageAlloc(cbBlock);
    3189     if (pbBuf)
    3190     {
    3191         memset(pbBuf, 0xf7, cbBlock);
    3192         PROFILE_IO_FN("RTFileWrite", fsPerfIoWriteWorker(hFile1, cbFile, cbBlock, pbBuf, &offActual, &cSeeks));
    3193         RTMemPageFree(pbBuf, cbBlock);
     3193    if (cbBlock <= cbFile)
     3194    {
     3195        uint8_t *pbBuf = (uint8_t *)RTMemPageAlloc(cbBlock);
     3196        if (pbBuf)
     3197        {
     3198            memset(pbBuf, 0xf7, cbBlock);
     3199            PROFILE_IO_FN("RTFileWrite", fsPerfIoWriteWorker(hFile1, cbFile, cbBlock, pbBuf, &offActual, &cSeeks));
     3200            RTMemPageFree(pbBuf, cbBlock);
     3201        }
     3202        else
     3203            RTTestSkipped(g_hTest, "insufficient (virtual) memory available");
    31943204    }
    31953205    else
    3196         RTTestSkipped(g_hTest, "insufficient (virtual) memory available");
     3206        RTTestSkipped(g_hTest, "test file too small");
    31973207}
    31983208
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