42 #ifndef SCI_Containers_FancyAssert_h
43 #define SCI_Containers_FancyAssert_h
45 #include <sci_defs/error_defs.h>
57 #if SCI_ASSERTION_LEVEL >= 2
58 #define ASSERTEQ(c1, c2) \
60 std::ostringstream msg; \
61 msg << #c1 << "(value=" << c1 << ") == " << #c2 << "(value=" << c2 << ")"; \
62 SCI_THROW(SCIRun::AssertionFailed(msg.str().c_str(), __FILE__, __LINE__)); \
65 #define ASSERTNE(c1, c2) \
67 std::ostringstream msg; \
68 msg << #c1 << "(value=" << c1 << ") != " << #c2 << "(value=" << c2 << ")"; \
69 SCI_THROW(SCIRun::AssertionFailed(msg.str().c_str(), __FILE__, __LINE__)); \
72 #define ASSERTRANGE(c, l, h) \
73 if(c < l || c >= h){ \
74 std::ostringstream msg; \
75 msg << #l "(value=" << l << ") <= " #c << "(value=" << c << ") < " << #h << "(value=" << h << ")"; \
76 SCI_THROW(SCIRun::AssertionFailed(msg.str().c_str(), __FILE__, __LINE__)); \
79 #define ASSERTEQ(c1, c2)
80 #define ASSERTRANGE(c, l, h)
Generic exception for internal errors.