VirtualBox

Changeset 36135 in vbox for trunk/src/VBox/Storage/testcase


Ignore:
Timestamp:
Mar 2, 2011 11:43:51 PM (14 years ago)
Author:
vboxsync
Message:

tstVDIo: New command for printing messages (no formatting) and a new I/O test script using data verification

Location:
trunk/src/VBox/Storage/testcase
Files:
1 added
1 edited

Legend:

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

    r36134 r36135  
    289289static DECLCALLBACK(int) vdScriptHandlerCompareDisks(PVDTESTGLOB pGlob, PVDSCRIPTARG paScriptArgs, unsigned cScriptArgs);
    290290static DECLCALLBACK(int) vdScriptHandlerDumpDiskInfo(PVDTESTGLOB pGlob, PVDSCRIPTARG paScriptArgs, unsigned cScriptArgs);
     291static DECLCALLBACK(int) vdScriptHandlerPrintMsg(PVDTESTGLOB pGlob, PVDSCRIPTARG paScriptArgs, unsigned cScriptArgs);
    291292
    292293/* create action */
     
    404405    /* pcszName    chId enmType                          fFlags */
    405406    {"disk",       'd', VDSCRIPTARGTYPE_STRING,          VDSCRIPTARGDESC_FLAG_MANDATORY},
     407};
     408
     409/* Print message */
     410const VDSCRIPTARGDESC g_aArgPrintMsg[] =
     411{
     412    /* pcszName    chId enmType                          fFlags */
     413    {"msg",        'm', VDSCRIPTARGTYPE_STRING,          VDSCRIPTARGDESC_FLAG_MANDATORY},
    406414};
    407415
     
    423431    {"comparedisks", g_aArgCompareDisks,  RT_ELEMENTS(g_aArgCompareDisks), vdScriptHandlerCompareDisks},
    424432    {"dumpdiskinfo", g_aArgDumpDiskInfo,  RT_ELEMENTS(g_aArgDumpDiskInfo), vdScriptHandlerDumpDiskInfo},
     433    {"print",        g_aArgPrintMsg,      RT_ELEMENTS(g_aArgPrintMsg),     vdScriptHandlerPrintMsg}
    425434};
    426435
     
    14421451}
    14431452
     1453static DECLCALLBACK(int) vdScriptHandlerPrintMsg(PVDTESTGLOB pGlob, PVDSCRIPTARG paScriptArgs, unsigned cScriptArgs)
     1454{
     1455    RTPrintf("%s\n", paScriptArgs[0].u.pcszString);
     1456    return VINF_SUCCESS;
     1457}
     1458
    14441459static DECLCALLBACK(int) tstVDIoFileOpen(void *pvUser, const char *pszLocation,
    14451460                                         uint32_t fOpen,
     
    15411556    PVDTESTGLOB pGlob = (PVDTESTGLOB)pvUser;
    15421557    bool fFound = false;
     1558
     1559    /*
     1560     * Some backends use ./ for paths, strip it.
     1561     * @todo: Implement proper directory support for the
     1562     * memory filesystem.
     1563     */
     1564    if (   strlen(pcszFilename) >= 2
     1565        && *pcszFilename == '.'
     1566        && pcszFilename[1] == '/')
     1567        pcszFilename += 2;
    15431568
    15441569    /* Check if the file exists. */
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