VirtualBox

Changeset 3111 in vbox


Ignore:
Timestamp:
Jun 14, 2007 5:42:48 PM (18 years ago)
Author:
vboxsync
Message:

Added some missing assert macros

File:
1 edited

Legend:

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

    r2981 r3111  
    819819#define AssertRCReturn(rc, rcRet)   AssertMsgRCReturn(rc, ("%Vra\n", (rc)), rcRet)
    820820
     821/** @def AssertRCReturnVoid
     822 * Asserts a iprt status code successful, bitch (RT_STRICT mode only) and return if it isn't.
     823 *
     824 * @param   rc      iprt status code.
     825 * @remark  rc is references multiple times. In release mode is NOREF()'ed.
     826 */
     827#define AssertRCReturnVoid(rc)   AssertMsgRCReturnVoid(rc, ("%Vra\n", (rc)))
     828
    821829/** @def AssertRCBreak
    822830 * Asserts a iprt status code successful, bitch (RT_STRICT mode only) and break if it isn't.
     
    853861    do { AssertMsgReturn(RT_SUCCESS(rc), msg, rcRet); NOREF(rc); } while (0)
    854862
     863/** @def AssertMsgRCReturnVoid
     864 * Asserts a iprt status code successful and if it's not return.
     865 *
     866 * If RT_STRICT is defined the message will be printed and a breakpoint hit before it returns
     867 *
     868 * @param   rc      iprt status code.
     869 * @param   msg     printf argument list (in parenthesis).
     870 * @remark  rc is references multiple times. In release mode is NOREF()'ed.
     871 */
     872#define AssertMsgRCReturnVoid(rc, msg) \
     873    do { AssertMsgReturnVoid(RT_SUCCESS(rc), msg); NOREF(rc); } while (0)
     874
    855875/** @def AssertMsgRCBreak
    856876 * Asserts a iprt status code successful and break if it's not.
     
    885905#define AssertRCSuccessReturn(rc, rcRet)    AssertMsgReturn((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), rcRet)
    886906
     907/** @def AssertRCSuccessReturnVoid
     908 * Asserts that an iprt status code equals VINF_SUCCESS, bitch (RT_STRICT mode only) and return if it isn't.
     909 *
     910 * @param   rc      iprt status code.
     911 * @remark  rc is references multiple times. In release mode is NOREF()'ed.
     912 */
     913#define AssertRCSuccessReturnVoid(rc)    AssertMsgReturnVoid((rc) == VINF_SUCCESS, ("%Vra\n", (rc)))
     914
    887915/** @def AssertRCSuccessBreak
    888916 * Asserts that an iprt status code equals VINF_SUCCESS, bitch (RT_STRICT mode only) and break if it isn't.
     
    917945#define AssertReleaseRCReturn(rc, rcRet) AssertReleaseMsgRCReturn(rc, ("%Vra\n", (rc)), rcRet)
    918946
     947/** @def AssertReleaseRCReturnVoid
     948 * Asserts a iprt status code successful, returning if it isn't.
     949 *
     950 * On failure information about the error will be printed, a breakpoint hit
     951 * and finally returning from the function if the breakpoint is somehow ignored.
     952 *
     953 * @param   rc      iprt status code.
     954 * @remark  rc is references multiple times.
     955 */
     956#define AssertReleaseRCReturnVoid(rc) AssertReleaseMsgRCReturnVoid(rc, ("%Vra\n", (rc)))
     957
    919958/** @def AssertReleaseRCBreak
    920959 * Asserts a iprt status code successful, break if it isn't.
     
    953992#define AssertReleaseMsgRCReturn(rc, msg, rcRet)    AssertReleaseMsgReturn(RT_SUCCESS(rc), msg, rcRet)
    954993
     994/** @def AssertReleaseMsgRCReturnVoid
     995 * Asserts a iprt status code successful.
     996 *
     997 * On failure a custom message is printed, a breakpoint is hit, and finally
     998 * returning from the function if the breakpoint is showhow ignored.
     999 *
     1000 * @param   rc      iprt status code.
     1001 * @param   msg     printf argument list (in parenthesis).
     1002 * @remark  rc is references multiple times.
     1003 */
     1004#define AssertReleaseMsgRCReturnVoid(rc, msg)    AssertReleaseMsgReturnVoid(RT_SUCCESS(rc), msg)
     1005
    9551006/** @def AssertReleaseMsgRCBreak
    9561007 * Asserts a iprt status code successful.
     
    9881039#define AssertReleaseRCSuccessReturn(rc, rcRet)     AssertReleaseMsgReturn((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), rcRet)
    9891040
     1041/** @def AssertReleaseRCSuccessReturnVoid
     1042 * Asserts that an iprt status code equals VINF_SUCCESS.
     1043 *
     1044 * On failure information about the error will be printed, a breakpoint hit
     1045 * and finally returning from the function if the breakpoint is somehow ignored.
     1046 *
     1047 * @param   rc      iprt status code.
     1048 * @remark  rc is references multiple times.
     1049 */
     1050#define AssertReleaseRCSuccessReturnVoid(rc)     AssertReleaseMsgReturnVoid((rc) == VINF_SUCCESS, ("%Vra\n", (rc)))
     1051
    9901052/** @def AssertReleaseRCSuccessBreak
    9911053 * Asserts that an iprt status code equals VINF_SUCCESS.
     
    10481110#define AssertPtrReturn(pv, rcRet)  AssertMsgReturn(VALID_PTR(pv), ("%p\n", (pv)), rcRet)
    10491111
     1112/** @def AssertPtrReturnVoid
     1113 * Asserts that a pointer is valid.
     1114 *
     1115 * @param   pv      The pointer.
     1116 */
     1117#define AssertPtrReturnVoid(pv)  AssertMsgReturnVoid(VALID_PTR(pv), ("%p\n", (pv)))
     1118
    10501119/** @def AssertPtrBreak
    10511120 * Asserts that a pointer is valid.
     
    10701139 */
    10711140#define AssertPtrNullReturn(pv, rcRet)  AssertMsgReturn(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)), rcRet)
     1141
     1142/** @def AssertPtrNullReturnVoid
     1143 * Asserts that a pointer is valid or NULL.
     1144 *
     1145 * @param   pv      The pointer.
     1146 */
     1147#define AssertPtrNullReturnVoid(pv)  AssertMsgReturnVoid(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)))
    10721148
    10731149/** @def AssertPtrNullBreak
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