Closed
Bug 779173
Opened 12 years ago
Closed 3 years ago
Add MOZ_ASSERT_PRINTF macro
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
DUPLICATE
of bug 1338574
People
(Reporter: vlad, Unassigned)
Details
It's often very helpful to be able to print some additional info in an assertion -- for example, to assert that error == NO_ERROR, but if the assertion triggers, to actually print the error. A new MOZ_ASSERT_PRINTF macro could handle this to avoid complicating the current assertions. (Alternatively, the current ones could be extended.)
Comment 1•12 years ago
|
||
Extending the current ones seems like the right thing to do.
Comment 2•12 years ago
|
||
An Android implementation of MOZ_ASSERT_PRINTF can use __android_log_vprint() to print va_list parameters to logcat.
Comment 3•3 years ago
|
||
MOZ_ASSERT
cannot take nsPrintfCString("%s", foo)
because of:
MOZ_REPORT_ASSERTION_FAILURE(#expr " (" explain ")", __FILE__, \
__LINE__); \
MOZ_CRASH_ANNOTATE(kind "(" #expr ") (" explain ")"); \
So, I'd be really happy if we have it.
Updated•3 years ago
|
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•