|
qxLib
|
Go to the source code of this file.
Macros | |
| #define | QX_ASSERT_C(condition, category, ...) _QX_ASSERT_C(condition, category, ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| #define | QX_ASSERT(condition, ...) QX_ASSERT_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| #define | QX_VERIFY_C(condition, category, ...) |
| Verifies that the condition is true. More... | |
| #define | QX_VERIFY(condition, ...) QX_VERIFY_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| #define | QX_EXPECT_C(condition, category, ...) |
| Verifies that the condition is true. More... | |
| #define | QX_EXPECT(condition, ...) QX_EXPECT_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| #define | QX_EXPECT_CONTINUE_C(condition, category, ...) _QX_EXPECT_ACTION(condition, category, continue, ##__VA_ARGS__) |
| Verifies that the condition is true and calls continue; otherwise. More... | |
| #define | QX_EXPECT_CONTINUE(condition, ...) QX_EXPECT_CONTINUE_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true and calls continue; otherwise. More... | |
| #define | QX_EXPECT_BREAK_C(condition, category, ...) _QX_EXPECT_ACTION(condition, category, break, ##__VA_ARGS__) |
| Verifies that the condition is true and calls break; otherwise. More... | |
| #define | QX_EXPECT_BREAK(condition, ...) QX_EXPECT_BREAK_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true and calls break; otherwise. More... | |
| #define | QX_EXPECT_RETURN_C(condition, category, ...) _QX_EXPECT_ACTION(condition, category, return, ##__VA_ARGS__) |
| Verifies that the condition is true and calls return; otherwise. More... | |
| #define | QX_EXPECT_RETURN(condition, ...) QX_EXPECT_RETURN_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true and calls return; otherwise. More... | |
| #define | QX_EXPECT_RETURN_CT(condition, category, return_value, ...) _QX_EXPECT_ACTION(condition, category, return return_value, ##__VA_ARGS__) |
| Verifies that the condition is true and calls return return_value; otherwise. More... | |
| #define | QX_EXPECT_RETURN_T(condition, return_value, ...) QX_EXPECT_RETURN_CT(condition, QX_GET_FILE_CATEGORY(), return_value, ##__VA_ARGS__) |
| Verifies that the condition is true and calls return return_value; otherwise. More... | |
| #define | QX_EXPECT_CO_RETURN_C(condition, category, ...) _QX_EXPECT_ACTION(condition, category, co_return, ##__VA_ARGS__) |
| Verifies that the condition is true and calls co_return; otherwise. More... | |
| #define | QX_EXPECT_CO_RETURN(condition, ...) QX_EXPECT_CO_RETURN_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true and calls co_return; otherwise. More... | |
| #define | QX_EXPECT_CO_RETURN_CT(condition, category, return_value, ...) _QX_EXPECT_ACTION(condition, category, co_return return_value, ##__VA_ARGS__) |
| Verifies that the condition is true and calls co_return return_value; otherwise. More... | |
| #define | QX_EXPECT_CO_RETURN_T(condition, return_value, ...) QX_EXPECT_CO_RETURN_CT(condition, QX_GET_FILE_CATEGORY(), return_value, ##__VA_ARGS__) |
| Verifies that the condition is true and calls co_return return_value; otherwise. More... | |
| #define | QX_ENSURE_C(condition, category, ...) _QX_ENSURE_C(condition, category, ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| #define | QX_ENSURE(condition, ...) QX_ENSURE_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
| Verifies that the condition is true. More... | |
| Assertion type | Crash on failure | Remains in shipping (can have side effects) | Returns condition | Description |
|---|---|---|---|---|
| QX_ASSERT | + | - | - | Fast fail, similar to assert() |
| QX_VERIFY | + | + | - | Critical places: allocation errors, security checks, encryption, anti-cheat, etc. |
| QX_EXPECT | - | + | + | Defensive programming |
| QX_ENSURE | - | - | - | Possibly heavy checks that will not stay in a fast build |
Definition in file asserts.h.
| #define QX_ASSERT | ( | condition, | |
| ... | |||
| ) | QX_ASSERT_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true.
QX_ASSERT macros generate fatal failures and disappear in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_ASSERT_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_ASSERT_C(condition, category, ##__VA_ARGS__) |
Verifies that the condition is true.
QX_ASSERT macros generate fatal failures and disappear in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_ENSURE | ( | condition, | |
| ... | |||
| ) | QX_ENSURE_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true.
QX_ENSURE macros generate nonfatal failures and disappear in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_ENSURE_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_ENSURE_C(condition, category, ##__VA_ARGS__) |
Verifies that the condition is true.
QX_ENSURE macros generate nonfatal failures and disappear in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT | ( | condition, | |
| ... | |||
| ) | QX_EXPECT_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| - | condition |
| #define QX_EXPECT_BREAK | ( | condition, | |
| ... | |||
| ) | QX_EXPECT_BREAK_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true and calls break; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_BREAK_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, break, ##__VA_ARGS__) |
Verifies that the condition is true and calls break; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_C | ( | condition, | |
| category, | |||
| ... | |||
| ) |
Verifies that the condition is true.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| - | condition |
| #define QX_EXPECT_CO_RETURN | ( | condition, | |
| ... | |||
| ) | QX_EXPECT_CO_RETURN_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true and calls co_return; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_CO_RETURN_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, co_return, ##__VA_ARGS__) |
Verifies that the condition is true and calls co_return; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_CO_RETURN_CT | ( | condition, | |
| category, | |||
| return_value, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, co_return return_value, ##__VA_ARGS__) |
Verifies that the condition is true and calls co_return return_value; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| return_value | - a value to return in case of failure |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_CO_RETURN_T | ( | condition, | |
| return_value, | |||
| ... | |||
| ) | QX_EXPECT_CO_RETURN_CT(condition, QX_GET_FILE_CATEGORY(), return_value, ##__VA_ARGS__) |
Verifies that the condition is true and calls co_return return_value; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| return_value | - a value to return in case of failure |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_CONTINUE | ( | condition, | |
| ... | |||
| ) | QX_EXPECT_CONTINUE_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true and calls continue; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_CONTINUE_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, continue, ##__VA_ARGS__) |
Verifies that the condition is true and calls continue; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_RETURN | ( | condition, | |
| ... | |||
| ) | QX_EXPECT_RETURN_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true and calls return; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_RETURN_C | ( | condition, | |
| category, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, return, ##__VA_ARGS__) |
Verifies that the condition is true and calls return; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_RETURN_CT | ( | condition, | |
| category, | |||
| return_value, | |||
| ... | |||
| ) | _QX_EXPECT_ACTION(condition, category, return return_value, ##__VA_ARGS__) |
Verifies that the condition is true and calls return return_value; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| return_value | - a value to return in case of failure |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_EXPECT_RETURN_T | ( | condition, | |
| return_value, | |||
| ... | |||
| ) | QX_EXPECT_RETURN_CT(condition, QX_GET_FILE_CATEGORY(), return_value, ##__VA_ARGS__) |
Verifies that the condition is true and calls return return_value; otherwise.
QX_EXPECT macros generate nonfatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| return_value | - a value to return in case of failure |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_VERIFY | ( | condition, | |
| ... | |||
| ) | QX_VERIFY_C(condition, QX_GET_FILE_CATEGORY(), ##__VA_ARGS__) |
Verifies that the condition is true.
QX_VERIFY macros generate fatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| ... | - optional user message and its format args. the format string should be without QXT |
| #define QX_VERIFY_C | ( | condition, | |
| category, | |||
| ... | |||
| ) |
Verifies that the condition is true.
QX_VERIFY macros generate fatal failures and remain in shipping. See Assert Types Comparison Table for details.
| condition | - a condition to check. if false, assert fails |
| category | - a category to use for logging and reporting |
| ... | - optional user message and its format args. the format string should be without QXT |