Macro
SEQAN_CHECK
Force abortion of program if a condition is not met, regardless of debugging settings.
SEQAN_CHECK(condition, msg[, args])
Include Headers
seqan/basic.h
Parameters
msg
A format string.
args
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.
enum MyEnum {
  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.
}
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:37