VirtualBox

Changeset 89468 in vbox


Ignore:
Timestamp:
Jun 2, 2021 1:18:28 PM (3 years ago)
Author:
vboxsync
Message:

Audio/ValKit: Added AudioTestPathGetTemp(). bugref:10008

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioTest.cpp

    r89465 r89468  
    593593
    594594/**
     595 * Retrieves the temporary directory.
     596 *
     597 * @returns VBox status code.
     598 * @param   pszPath             Where to return the absolute path of the created directory on success.
     599 * @param   cbPath              Size (in bytes) of \a pszPath.
     600 */
     601int AudioTestPathGetTemp(char *pszPath, size_t cbPath)
     602{
     603    int rc = RTEnvGetEx(RTENV_DEFAULT, "TESTBOX_PATH_SCRATCH", pszPath, cbPath, NULL);
     604    if (RT_FAILURE(rc))
     605    {
     606        rc = RTPathTemp(pszPath, cbPath);
     607        AssertRCReturn(rc, rc);
     608    }
     609
     610    return rc;
     611}
     612
     613/**
    595614 * Creates a new temporary directory with a specific (test) tag.
    596615 *
     
    608627
    609628    char szTemp[RTPATH_MAX];
    610     int rc = RTEnvGetEx(RTENV_DEFAULT, "TESTBOX_PATH_SCRATCH", szTemp, sizeof(szTemp), NULL);
    611     if (RT_FAILURE(rc))
    612     {
    613         rc = RTPathTemp(szTemp, sizeof(szTemp));
    614         AssertRCReturn(rc, rc);
    615     }
     629    int rc = AudioTestPathGetTemp(szTemp, sizeof(szTemp));
     630    AssertRCReturn(rc, rc);
    616631
    617632    rc = AudioTestPathCreate(szTemp, sizeof(szTemp), pszTag);
  • trunk/src/VBox/Devices/Audio/AudioTest.h

    r89465 r89468  
    342342int    AudioTestToneParamsInitRandom(PAUDIOTESTTONEPARMS pToneParams, PPDMAUDIOPCMPROPS pProps);
    343343
     344int    AudioTestPathGetTemp(char *pszPath, size_t cbPath);
    344345int    AudioTestPathCreateTemp(char *pszPath, size_t cbPath, const char *pszUUID);
    345346int    AudioTestPathCreate(char *pszPath, size_t cbPath, const char *pszUUID);
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