VirtualBox

Ignore:
Timestamp:
May 31, 2021 9:55:04 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144738
Message:

ValKit/AudioTest: Extensible wav-file support. Don't use RTMsgError++ in generic library files, so ferry error info back via RTERRINFO. Set up a release logger instance for the audio test program and point it at stderr. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r89383 r89387  
    4848
    4949#include <VBox/version.h>
     50#include <VBox/log.h>
    5051
    5152#ifdef RT_OS_WINDOWS
     
    8182            case 'q': \
    8283                g_uVerbosity = 0; \
     84                if (g_pRelLogger) \
     85                    RTLogGroupSettings(g_pRelLogger, "all=0 all.e"); \
    8386                break; \
    8487            \
    8588            case 'v': \
    8689                g_uVerbosity++; \
     90                if (g_pRelLogger) \
     91                    RTLogGroupSettings(g_pRelLogger, g_uVerbosity == 1 ? "all.e.l" : g_uVerbosity == 2 ? "all.e.l.f" : "all=~0"); \
    8792                break; \
    8893            \
     
    374379/** The test handle. */
    375380static RTTEST       g_hTest;
     381/** The release logger. */
     382static PRTLOGGER    g_pRelLogger = NULL;
    376383/** The current verbosity level. */
    377384static unsigned     g_uVerbosity = 0;
     
    24032410     * First we must open the file and determin the format.
    24042411     */
     2412    RTERRINFOSTATIC ErrInfo;
    24052413    AUDIOTESTWAVEFILE WaveFile;
    2406     int rc = AudioTestWaveFileOpen(pszFile, &WaveFile);
     2414    int rc = AudioTestWaveFileOpen(pszFile, &WaveFile, RTErrInfoInitStatic(&ErrInfo));
    24072415    if (RT_FAILURE(rc))
    2408         return RTMsgErrorExitFailure("Failed to open '%s': %Rrc", pszFile, rc);
     2416        return RTMsgErrorExitFailure("Failed to open '%s': %Rrc%#RTeim", pszFile, rc, &ErrInfo.Core);
    24092417
    24102418    if (g_uVerbosity > 0)
     
    30193027
    30203028    /*
     3029     * Configure release logging to go to stderr.
     3030     */
     3031    static const char * const g_apszLogGroups[] = VBOX_LOGGROUP_NAMES;
     3032    int rc = RTLogCreate(&g_pRelLogger, RTLOGFLAGS_PREFIX_THREAD, "all.e.l", "VKAT_RELEASE_LOG",
     3033                         RT_ELEMENTS(g_apszLogGroups), g_apszLogGroups, RTLOGDEST_STDERR, "vkat-release.log");
     3034    if (RT_SUCCESS(rc))
     3035        RTLogRelSetDefaultInstance(g_pRelLogger);
     3036    else
     3037        RTMsgWarning("Failed to create release logger: %Rrc", rc);
     3038
     3039    /*
    30213040     * Process common options.
    30223041     */
    30233042    RTGETOPTSTATE GetState;
    3024     int rc = RTGetOptInit(&GetState, argc, argv, g_aCmdCommonOptions,
    3025                           RT_ELEMENTS(g_aCmdCommonOptions), 1 /*idxFirst*/, 0 /*fFlags - must not sort! */);
     3043    rc = RTGetOptInit(&GetState, argc, argv, g_aCmdCommonOptions,
     3044                      RT_ELEMENTS(g_aCmdCommonOptions), 1 /*idxFirst*/, 0 /*fFlags - must not sort! */);
    30263045    AssertRCReturn(rc, RTEXITCODE_INIT);
    30273046
     
    30333052            case 'q':
    30343053                g_uVerbosity = 0;
     3054                if (g_pRelLogger)
     3055                    RTLogGroupSettings(g_pRelLogger, "all=0 all.e");
    30353056                break;
    30363057
    30373058            case 'v':
    30383059                g_uVerbosity++;
     3060                if (g_pRelLogger)
     3061                    RTLogGroupSettings(g_pRelLogger, g_uVerbosity == 1 ? "all.e.l" : g_uVerbosity == 2 ? "all.e.l.f" : "all=~0");
    30393062                break;
    30403063
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette