Changeset 32795 in vbox
- Timestamp:
- Sep 28, 2010 2:45:08 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 66244
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/test.h
r28800 r32795 512 512 * Check whether a boolean expression holds true, returns on false. 513 513 * 514 * If the expression is false, call RTTestFailed giving the line number and expression. 514 * If the expression is false, call RTTestFailed giving the line number and 515 * expression, then return @a rcRet. 515 516 * 516 517 * @param hTest The test handle. … … 527 528 * Check whether a boolean expression holds true, returns void on false. 528 529 * 529 * If the expression is false, call RTTestFailed giving the line number and expression. 530 * If the expression is false, call RTTestFailed giving the line number and 531 * expression, then return void. 530 532 * 531 533 * @param hTest The test handle. … … 538 540 } \ 539 541 } while (0) 542 /** @def RTTEST_CHECK_BREAK 543 * Check whether a boolean expression holds true. 544 * 545 * If the expression is false, call RTTestFailed giving the line number and 546 * expression, then break. 547 * 548 * @param hTest The test handle. 549 * @param expr The expression to evaluate. 550 */ 551 #define RTTEST_CHECK_BREAK(hTest, expr) \ 552 if (!(expr)) { \ 553 RTTestFailed((hTest), "line %u: %s", __LINE__, #expr); \ 554 break; \ 555 } else do {} while (0) 540 556 541 557 … … 652 668 } \ 653 669 } while (0) 670 /** @def RTTEST_CHECK_RC_BREAK 671 * Check whether an expression returns a specific IPRT style status code. 672 * 673 * If a different status code is return, call RTTestFailed giving the line 674 * number, expression, actual and expected status codes, then break. 675 * 676 * @param hTest The test handle. 677 * @param rcExpr The expression resulting in an IPRT status code. 678 * @param rcExpect The expected return code. This may be referenced 679 * more than once by the macro. 680 */ 681 #define RTTEST_CHECK_RC_BREAK(hTest, rcExpr, rcExpect) \ 682 if (1) { \ 683 int rcCheck = (rcExpr); \ 684 if (rcCheck != (rcExpect)) { \ 685 RTTestFailed((hTest), "line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \ 686 break; \ 687 } \ 688 } else do {} while (0) 654 689 655 690 … … 935 970 * 936 971 * If the expression is false, call RTTestIFailed giving the line number and 937 * expression .972 * expression, then return @a rcRet. 938 973 * 939 974 * @param expr The expression to evaluate. … … 950 985 * 951 986 * If the expression is false, call RTTestIFailed giving the line number and 952 * expression .987 * expression, then return void. 953 988 * 954 989 * @param expr The expression to evaluate. … … 960 995 } \ 961 996 } while (0) 997 /** @def RTTESTI_CHECK_RETV 998 * Check whether a boolean expression holds true, returns void on false. 999 * 1000 * If the expression is false, call RTTestIFailed giving the line number and 1001 * expression, then break. 1002 * 1003 * @param expr The expression to evaluate. 1004 */ 1005 #define RTTESTI_CHECK_BREAK(expr) \ 1006 if (!(expr)) { \ 1007 RTTestIFailed("line %u: %s", __LINE__, #expr); \ 1008 break; \ 1009 } do {} while (0) 962 1010 963 1011 … … 1071 1119 } \ 1072 1120 } while (0) 1121 /** @def RTTESTI_CHECK_RC_BREAK 1122 * Check whether an expression returns a specific IPRT style status code. 1123 * 1124 * If a different status code is return, call RTTestIFailed giving the line 1125 * number, expression, actual and expected status codes, then break. 1126 * 1127 * @param rcExpr The expression resulting in an IPRT status code. 1128 * @param rcExpect The expected return code. This may be referenced 1129 * more than once by the macro. 1130 */ 1131 #define RTTESTI_CHECK_RC_BREAK(rcExpr, rcExpect) \ 1132 if (1) { \ 1133 int rcCheck = (rcExpr); \ 1134 if (rcCheck != (rcExpect)) { \ 1135 RTTestIFailed("line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \ 1136 break; \ 1137 } \ 1138 } else do {} while (0) 1073 1139 1074 1140
Note:
See TracChangeset
for help on using the changeset viewer.