29 #ifndef MU_PARSER_TEST_H
30 #define MU_PARSER_TEST_H
41 #pragma warning(disable : 4251) // ...needs to have dll-interface to be used by clients of class ...
106 return a_afArg[a_iArgc - 1];
115 for (
int i = 0; i < a_iArgc; ++i) fRes += a_afArg[i];
121 return (
value_type)(1 + (v * std::rand() / (RAND_MAX + 1.0)));
126 return (
value_type)(1.0 + (1000.0 * std::rand() / (RAND_MAX + 1.0)));
157 return val + v2 + v3;
164 return val + v2 + v3 + v4;
171 return val + v2 + v3 + v4 + v5;
178 return val + v2 + v3 + v4 + v5 + v6;
210 return reinterpret_cast<std::intptr_t
>(data);
215 return reinterpret_cast<std::intptr_t
>(data) + v;
220 return reinterpret_cast<std::intptr_t
>(data) + v1 + v2;
223 static value_type FunUd10(
void* data,
value_type v1,
value_type v2,
value_type v3,
value_type v4,
value_type v5,
value_type v6,
value_type v7,
value_type v8,
value_type v9,
value_type v10)
225 return reinterpret_cast<std::intptr_t
>(data) + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;
232 return reinterpret_cast<std::intptr_t
>(data) + val + v2 + v3;
241 for (
int i = 0; i < a_iArgc; ++i)
244 return reinterpret_cast<std::intptr_t
>(data) + fRes;
251 int TestExpression();
258 int TestIfThenElse();
260 int TestOssFuzzTestCases();
262 int TestLocalization();
273 std::vector<testfun_type> m_vTestFun;
274 void AddTest(testfun_type a_pFun);
277 int EqnTest(
const string_type& a_str,
double a_fRes,
bool a_fPass);
278 int EqnTestWithVarChange(
const string_type& a_str,
double a_fRes1,
double a_fVar1,
double a_fRes2,
double a_fVar2);
279 int EqnTestLocalized(
const string_type& a_str,
double a_fRes,
bool a_fPass);
280 int ThrowTest(
const string_type& a_str,
int a_iErrc,
bool a_bFail =
true);
283 int EqnTestInt(
const string_type& a_str,
double a_fRes,
bool a_fPass);
286 int EqnTestBulk(
const string_type& a_str,
double a_fRes[4],
bool a_fPass);
293 #if defined(_MSC_VER)
#define _T(x)
Activate this option in order to compile with OpenMP support.
Definition of a parser using integer value.
Definition of the standard floating point parser.
std::basic_stringstream< char_type, std::char_traits< char_type >, std::allocator< char_type > > stringstream_type
Typedef for easily using stringstream that respect the parser stringtype.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Test cases for unit testing.
Namespace for mathematical applications.
string_type::value_type char_type
The character type used by the parser.
MUP_STRING_TYPE string_type
The stringtype used by the parser.
ParserError exception_type
Type of the error class.