ModAssert and Rich Booleans
ModAssert is a very advanced open source assertion package for C++. It is gaining popularity thanks to its flexibility and ease of use. It uses Rich Booleans to create an analysis of what went wrong if an assertion fails.
The most basic assertion packages let you write something like
ASSERT(a==foo(b));
which shows a dialog box if the condition fails.
ModAssert on the other hand lets you write
MOD_ASSERT_P(b, rbEQUAL(a, foo(b)));
and lets the programmer choose what happens when the condition fails: show it in a dialog box, log it to a file, log it to a custom logger or displayer, or any combination of these. Furthermore a text like `a':<1> == `foo(b)':<2> nok will be shown (generated by the Rich Boolean macro rbEQUAL(a, foo(b)) ) where the expressions are between ` and ', and their values are between < and >. The value of b is also shown (the first parameter of the assertion).
This is just a small sample of the present features. And even more features are planned, so it sure will stay ahead of other assertion packages. It also integrates nicely with our unit testing package for C++ (to be released soon), by reporting failed assertions in domain code as a failure instead of showing a dialog box.
Q-Mentum offers support for ModAssert, together with support for the Rich Booleans package that is used in ModAssert. Contact us at sales@q-mentum.com for more information about support.
| Name | Language | Type | Description | License |
| Rich Booleans | C++ | Library | A set of boolean-like expressions, like rbEQUAL(a,b), that hold extra information if they evaluate to false, to inform the user why it evaluated to false, e.g. by showing the values of a and b. | Boost license |
| ModAssert | C++ | Library | A package of 24 variations on the ASSERT macro, that can have these rich booleans as an argument, like MOD_ASSERT(rbEQUAL(a,b)), but also regular boolean expressions. | Boost license |