Macro
SEQAN_CHECK
Force abortion of program if a condition is not met, regardless of debugging settings.
Include Headers
seqan/basic.h
Parameters
A format string. | |
An optional list of arguments. |
Remarks
Use this if something really unexpected happens inside your functions and there is no way to report this through the API. A good example would be logic errors, e.g. invalid values.
Examples
In the following example, the SEQAN_CHECK stops program execution if a value is added to MyEnum but the function foo is not updated accordingly.
VALUE_ONE,
VALUE_TWO
};
bool foo(MyEnum x) {
SEQAN_CHECK((x == VALUE_ONE || x == VALUE_TWO), "Invalid value for x == %d.", x);
switch (x) {
case VALUE_ONE:
// do something
return true;
case VALUE_TWO:
// do something
return true;
}
return false; // Should never reach here, checked above with SEQAN_CHECK.
}
See Also
SeqAn - Sequence Analysis Library - www.seqan.de