by linuxlizard · 13y ago · 0 comments
xassert(condition,value);
e.g., xassert(result==3,result);
When the assert fails, the value is also reported. Helps with the question, "So it's not 3. What is it?"
I started using xassert when working in embedded systems where there is no debugger, no stack trace. Knowing the value of the error is valuable.
retcode = some_os_function(blah,blah,blah); xassert(retcode==OS_SUCCESS,retcode); <--- why did my call fail?