mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Wrap TEST_ASSERT with do...while(0)
Fix compile errors when doing if (blah) TEST_ASSERT(cond, message)
This commit is contained in:
committed by
Baldur Karlsson
parent
a7ac9d7923
commit
f14130fc2d
@@ -316,12 +316,15 @@ std::string trim(const std::string &str);
|
||||
|
||||
void DebugPrint(const char *fmt, ...);
|
||||
|
||||
#define TEST_ASSERT(cond, fmt, ...) \
|
||||
if(!(cond)) \
|
||||
{ \
|
||||
DebugPrint("%s:%d Assert Failure '%s': " fmt "\n", __FILE__, __LINE__, #cond, ##__VA_ARGS__); \
|
||||
DEBUG_BREAK(); \
|
||||
}
|
||||
#define TEST_ASSERT(cond, fmt, ...) \
|
||||
do \
|
||||
{ \
|
||||
if(!(cond)) \
|
||||
{ \
|
||||
DebugPrint("%s:%d Assert Failure '%s': " fmt "\n", __FILE__, __LINE__, #cond, ##__VA_ARGS__); \
|
||||
DEBUG_BREAK(); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define TEST_LOG(fmt, ...) \
|
||||
do \
|
||||
|
||||
Reference in New Issue
Block a user