ModAssert, an advanced assertion package

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
Post Reply
markvp
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Jul 15, 2005 8:26 am

ModAssert, an advanced assertion package

Post by markvp »

If you like using assertions, or don't like them because you think they are not powerful enough, have a look at my open source ModAssert package on Sourceforge: http://sourceforge.net/projects/modassert/. It has 24 assertion macros. They allow you to add expressions to show if the assertions fails. You can also add levels and groups, and an optional action.

On top of that, the condition can be replaced with a Rich Boolean, that gives an informative analysis of why the condition failed (e.g. to show which bits are different in two integers if you ask for a bitwise comparison, or which elements of two wxArrays are different). See http://sourceforge.net/projects/rich-booleans/ to download the Rich Booleans (needed by ModAssert).

Using it can be as simple as

Code: Select all

MOD_ASSERT(a==1);
or as advanced as

Code: Select all

MOD_ASSERT_PTO(b<<c, ModAssert::Error, return false, "return false", rbEQUAL(a,1));
It is extensible in many ways:
- write your own dialog to display assertions (one for wxWidgets is already provided)
- write your own assertion logger (one for wxWidgets is already provided)
- write your own Rich Booleans (over 70 already provided)
- extend the context displayed, to show more than just the file and linenumber (e.g. threadid, backtrace, ...)

It allows you to compile out assertions per level, group, file or all at once. Displaying and logging of failed assertions can be controlled at runtime per level, group, file or all at once.

A small demo application that uses wxWidgets is provided. This also demonstrates how you can reroute wxWidgets assertion macros to ModAssert.
[/url]
markvp
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Jul 15, 2005 8:26 am

ModAssert - addendum

Post by markvp »

I should add that it is still a beta, but well tested. The API has changed a lot since version 0.1, but will most likely remain backward compatible from now on.

I post it now, because I'd like to get feedback (both ModAssert and Rich Booleans) from users before releasing the version 1.0.
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave »

Thanks for this.
Post Reply