Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_LocalTestingHelpers.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_LOCAL_TESTING_HELPERS_HPP
11 #define TEUCHOS_LOCAL_TESTING_HELPERS_HPP
12 
13 
25 
26 
31 #define ECHO( statement ) \
32  TEUCHOS_ECHO( statement, out )
33 
34 
39 #define TEST_ASSERT( v1 ) \
40  TEUCHOS_TEST_ASSERT( v1, out, success )
41 
42 
47 #define TEST_EQUALITY_CONST( v1, v2 ) \
48  TEUCHOS_TEST_EQUALITY_CONST( v1, v2, out, success )
49 
50 
55 #define TEST_EQUALITY( v1, v2 ) \
56  TEUCHOS_TEST_EQUALITY( v1, v2, out, success )
57 
58 
63 #define TEST_INEQUALITY_CONST( v1, v2 ) \
64  TEUCHOS_TEST_INEQUALITY_CONST( v1, v2, out, success )
65 
66 
71 #define TEST_INEQUALITY( v1, v2 ) \
72  TEUCHOS_TEST_INEQUALITY( v1, v2, out, success )
73 
74 
80 #define TEST_FLOATING_EQUALITY( v1, v2, tol ) \
81  TEUCHOS_TEST_FLOATING_EQUALITY( v1, v2, tol, out, success )
82 
83 
88 #define TEST_ITER_EQUALITY( iter1, iter2 ) \
89  TEUCHOS_TEST_ITER_EQUALITY( iter1, iter2, out, success )
90 
91 
96 #define TEST_ITER_INEQUALITY( iter1, iter2 ) \
97  TEUCHOS_TEST_ITER_INEQUALITY( iter1, iter2, out, success )
98 
99 
104 #define TEST_ARRAY_ELE_EQUALITY( a, i, val ) \
105  TEUCHOS_TEST_ARRAY_ELE_EQUALITY( a, i, val, false, out, local_success )
106 
107 
112 #define TEST_ARRAY_ELE_INEQUALITY( a, i, val ) \
113  TEUCHOS_TEST_ARRAY_ELE_INEQUALITY( a, i, val, false, out, local_success )
114 
115 
120 #define TEST_COMPARE( v1, comp, v2 ) \
121  TEUCHOS_TEST_COMPARE( v1, comp, v2, out, success )
122 
123 
129 #define TEST_COMPARE_CONST( v1, comp, v2 ) \
130  TEUCHOS_TEST_COMPARE_CONST( v1, comp, v2, out, success )
131 
132 
140 #define TEST_COMPARE_ARRAYS( a1, a2 ) \
141  { \
142  const bool l_result = compareArrays(a1,#a1,a2,#a2,out); \
143  if (!l_result) success = false; \
144  }
145 
146 
154 #define TEST_COMPARE_FLOATING_ARRAYS( a1, a2, tol ) \
155  { \
156  const bool result = compareFloatingArrays(a1,#a1,a2,#a2,tol,out); \
157  if (!result) success = false; \
158  }
159 
168 #define TEST_ABSOLUTE_COMPARE_FLOATING_ARRAYS( a1, a2, tol ) \
169  { \
170  const bool result = compareFloatingArraysAbsolute(a1,#a1,a2,#a2,tol,out); \
171  if (!result) success = false; \
172  }
173 
179 #define TEST_THROW( code, ExceptType ) \
180  TEUCHOS_TEST_THROW( code, ExceptType, out, success )
181 
182 
187 #define TEST_NOTHROW( code ) \
188  TEUCHOS_TEST_NOTHROW( code, out, success )
189 
190 
191 #endif // TEUCHOS_LOCAL_TESTING_HELPERS_HPP
Utilities to make writing tests easier.