18 #define TEST_NOTHROW(expression, MSG) \ 21 MITK_TEST_OUTPUT_NO_ENDL(<< MSG) \ 22 bool test_caught = false; \ 30 MITK_TEST_FAILED_MSG(<< "An unwanted exception was thrown"); \ 34 MITK_TEST_OUTPUT(<< " [PASSED]") \ 35 mitk::TestManager::GetInstance()->TestPassed(); \ 42 class FormulaParserTests
45 static void TestConstructor()
47 std::map<std::string, double> varMap;
51 "Testing constructor with NULL argument");
53 "Testing constructor with valid argument");
59 static void TestLookupVariable()
67 std::map<std::string, double> varMap;
75 "Testing if lookupVariable throws unwanted exceptions");
77 "Testing if lookupVariable returns the correct value");
82 static void TestParse()
84 std::map<std::string, double> varMap;
104 "Testing if addition throws an unwanted exception");
106 "Testing if addition produces the correct result");
110 "Testing if subtraction throws an unwanted exception");
112 "Testing if subtraction produces the correct result");
116 "Testing if multiplication throws an unwanted exception");
118 "Testing if multiplication produces the correct result");
122 "Testing if division throws an unwanted exception");
124 "Testing if division produces the correct result");
135 "Testing if algebraic signs throw an unwanted exception");
137 "Testing if algebraic signs produce the correct result");
141 "Testing if parentheses throw an unwanted exception");
143 "Testing if parentheses produce the correct result");
147 "Testing if variables throw an unwanted exception");
149 "Testing if variables produce the correct result");
153 "Testing if abs throws an unwanted exception");
155 "Testing if abs produces the correct result");
157 const double eps = 0.0001;
161 "Testing if exp throws an unwanted exception");
163 "Testing if exp produces the correct result");
167 "Testing if sin throws an unwanted exception");
169 "Testing if sin produces the correct result");
173 "Testing if cos throws an unwanted exception");
175 "Testing if cos produces the correct result");
179 "Testing if tan throws an unwanted exception");
181 "Testing if tan produces the correct result");
185 "Testing if sind throws an unwanted exception");
187 "Testing if sind produces the correct result");
191 "Testing if cosd throws an unwanted exception");
193 "Testing if cosd produces the correct result");
197 "Testing if tand throws an unwanted exception");
199 "Testing if tand produces the correct result");
203 "Testing if fresnelS throws an unwanted exception");
205 "Testing if fresnelS produces the correct result");
208 "Testing if fresnelC throws an unwanted exception");
210 "Testing if fresnelC produces the correct result");
220 FormulaParserTests::TestConstructor();
221 FormulaParserTests::TestLookupVariable();
222 FormulaParserTests::TestParse();
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
DataCollection - Class to facilitate loading/accessing structured data.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_FOR_EXCEPTION(EXCEPTIONCLASS, STATEMENT)
Simplified version of MITK_TEST_FOR_EXCEPTION_BEGIN / END for a single statement. ...
MITKCORE_EXPORT const ScalarType eps