Changeset 88967 in vbox for trunk/src/VBox/Devices/Audio/AudioTest.cpp
- Timestamp:
- May 10, 2021 5:33:06 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r88961 r88967 25 25 #include <VBox/vmm/pdmaudioinline.h> 26 26 27 #include <iprt/dir.h> 27 28 #include <iprt/rand.h> 29 #include <iprt/uuid.h> 28 30 29 31 #define _USE_MATH_DEFINES … … 206 208 } 207 209 210 int AudioTestPathCreate(char *pszPath, size_t cbPath, const char *pszTag) 211 { 212 int rc; 213 214 char szTag[RTUUID_STR_LENGTH + 1]; 215 if (pszTag) 216 { 217 rc = RTStrCopy(szTag, sizeof(szTag), pszTag); 218 AssertRCReturn(rc, rc); 219 } 220 else /* Create an UUID if no tag is specified. */ 221 { 222 RTUUID UUID; 223 rc = RTUuidCreate(&UUID); 224 AssertRCReturn(rc, rc); 225 rc = RTUuidToStr(&UUID, szTag, sizeof(szTag)); 226 AssertRCReturn(rc, rc); 227 } 228 229 char szName[128]; 230 rc = RTStrPrintf(szName, sizeof(szName), "%s%s", AUDIOTEST_PATH_PREFIX_STR, szTag); 231 AssertRCReturn(rc, rc); 232 233 rc = RTPathAppend(pszPath, cbPath, szName); 234 AssertRCReturn(rc, rc); 235 236 char szTime[64]; 237 RTTIMESPEC time; 238 if (!RTTimeSpecToString(RTTimeNow(&time), szTime, sizeof(szTime))) 239 return VERR_BUFFER_UNDERFLOW; 240 241 rc = RTPathAppend(pszPath, cbPath, szTime); 242 AssertRCReturn(rc, rc); 243 244 return RTDirCreateFullPath(pszPath, RTFS_UNIX_IRWXU); 245 } 246 247 int AudioTestPathCreateTemp(char *pszPath, size_t cbPath, const char *pszTag) 248 { 249 int rc = RTPathTemp(pszPath, cbPath); 250 AssertRCReturn(rc, rc); 251 rc = AudioTestPathCreate(pszPath, cbPath, pszTag); 252 AssertRCReturn(rc, rc); 253 254 return rc; 255 } 256 257 int AudioTestSetCreate(PAUDIOTESTSET pSet, const char *pszPath, const char *pszTag) 258 { 259 int rc; 260 261 if (pszPath) 262 { 263 rc = RTStrCopy(pSet->szPathOutAbs, sizeof(pSet->szPathOutAbs), pszPath); 264 AssertRCReturn(rc, rc); 265 266 rc = AudioTestPathCreate(pSet->szPathOutAbs, sizeof(pSet->szPathOutAbs), pszTag); 267 } 268 else 269 rc = AudioTestPathCreateTemp(pSet->szPathOutAbs, sizeof(pSet->szPathOutAbs), pszTag); 270 AssertRCReturn(rc, rc); 271 272 return rc; 273 } 274 275 void AudioTestSetDestroy(PAUDIOTESTSET pSet) 276 { 277 RT_NOREF(pSet); 278 } 279 280 int AudioTestSetOpen(PAUDIOTESTSET pSet, const char *pszPath, const char *pszTag) 281 { 282 RT_NOREF(pSet, pszPath, pszTag); 283 284 return VERR_NOT_IMPLEMENTED; 285 } 286 287 void AudioTestSetClose(PAUDIOTESTSET pSet) 288 { 289 AudioTestSetDestroy(pSet); 290 } 291 292 int AudioTestSetPack(PAUDIOTESTSET pSet, const char *pszOutDir) 293 { 294 RT_NOREF(pSet, pszOutDir); 295 // RTZipTarCmd() 296 297 return VERR_NOT_IMPLEMENTED; 298 } 299 300 int AudioTestSetUnpack(const char *pszFile, const char *pszOutDir) 301 { 302 RT_NOREF(pszFile, pszOutDir); 303 // RTZipTarCmd() 304 305 return VERR_NOT_IMPLEMENTED; 306 } 307 308 int AudioTestSetVerify(PAUDIOTESTSET pSet, const char *pszTag) 309 { 310 RT_NOREF(pSet, pszTag); 311 //RTIniFileQueryPair() 312 313 /** @todo Compare tag with test set. */ 314 315 return VERR_NOT_IMPLEMENTED; 316 } 317
Note:
See TracChangeset
for help on using the changeset viewer.