10 #ifndef TEUCHOS_ASSERT_HPP
11 #define TEUCHOS_ASSERT_HPP
23 #define TEUCHOS_ASSERT(assertion_test) TEUCHOS_TEST_FOR_EXCEPT(!(assertion_test))
30 #define TEUCHOS_DEBUG_ASSERT(assertion_test) TEUCHOS_ASSERT(assertion_test)
32 #define TEUCHOS_DEBUG_ASSERT(assertion_test)
50 #define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( index, lower_inclusive, upper_exclusive ) \
52 TEUCHOS_TEST_FOR_EXCEPTION( \
53 !( (lower_inclusive) <= (index) && (index) < (upper_exclusive) ), \
55 "Error, the index " #index " = " << (index) << " does not fall in the range" \
56 "["<<(lower_inclusive)<<","<<(upper_exclusive)<<")!" ); \
73 #define TEUCHOS_ASSERT_EQUALITY( val1, val2 ) \
75 TEUCHOS_TEST_FOR_EXCEPTION( \
76 (val1) != (val2), std::out_of_range, \
77 "Error, (" #val1 " = " << (val1) << ") != (" #val2 " = " << (val2) << ")!" ); \
94 #define TEUCHOS_ASSERT_INEQUALITY( val1, comp, val2 ) \
96 TEUCHOS_TEST_FOR_EXCEPTION( \
97 !( (val1) comp (val2) ), std::out_of_range, \
98 "Error, (" #val1 " = " << (val1) << ") " \
99 #comp " (" #val2 " = " << (val2) << ")! FAILED!" ); \
103 #endif // TEUCHOS_ASSERT_HPP
Standard test and throw macros.