VirtualBox

Changeset 107050 in vbox for trunk/include


Ignore:
Timestamp:
Nov 20, 2024 9:25:52 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166002
Message:

iprt/test.h: Added RTTEST_CHECK_RC_OK_BREAK.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/test.h

    r106061 r107050  
    982982        } \
    983983    } while (0)
     984/** @def RTTEST_CHECK_RC_OK_BREAK
     985 * Check whether a IPRT style status code indicates success.
     986 *
     987 * If the status indicates failure, call RTTestFailed giving the line number,
     988 * expression and status code, then break.
     989 *
     990 * @param   hTest           The test handle.
     991 * @param   rcExpr          The expression resulting in an IPRT status code.
     992 *                          This will be assigned to a local rcCheck variable
     993 *                          that can be used as return value.
     994 */
     995#define RTTEST_CHECK_RC_OK_BREAK(hTest, rcExpr) \
     996    do { \
     997        int rcCheck = (rcExpr); \
     998        if (RT_FAILURE(rcCheck)) { \
     999            RTTestFailed((hTest), "line %u: %s: %Rrc", __LINE__, #rcExpr, rcCheck); \
     1000            break; \
     1001        } \
     1002    } while (0)
    9841003/** @def RTTEST_CHECK_RC_OK_RET
    9851004 * Check whether a IPRT style status code indicates success.
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