User forums > General (but related to Code::Blocks)

using macros wxCHECK_MSG(..,..,..)

<< < (3/3)

Miguel Gimenez:
They will be checked after the failing one has been fixed.

omlk:

--- Quote from: Miguel Gimenez on November 13, 2023, 02:22:53 pm ---They will be checked after the failing one has been fixed.

--- End quote ---
OK, is that what you wanted? replacing assert?  :)

Miguel Gimenez:
assert generates an exception only in debug mode, wx debugging macros are a lot more informative in release and debug mode.

End trans.

omlk:

--- Quote from: Miguel Gimenez on November 13, 2023, 02:32:59 pm ---assert generates an exception only in debug mode, wx debugging macros are a lot more informative in release and debug mode.

End trans.

--- End quote ---
That is, there is no option in the widgets to see all the problems at once? just correct one at a time and watch the next one after fix?

blauzahn:
Yes. That is exactly what they are intended for. Fail fast on an eventually corrupted state.

according to https://en.cppreference.com/w/cpp/error/assert:

--- Quote ---...outputs implementation-specific diagnostic information on the standard error output and calls std::abort.
--- End quote ---

At least as important: An assert serves as executable note to the next reader.

If on the other hand an assert actually threw an exception it would indeed be possible to proceed and see subsequent behaviour. If you really want to, you could redefine the macro. Good luck with that. Instead of that I would rather use unittests.

Navigation

[0] Message Index

[*] Previous page

Go to full version