26#ifndef MU_PARSER_TEST_H
27#define MU_PARSER_TEST_H
99 return a_afArg[a_iArgc-1];
108 for (
int i=0; i<a_iArgc; ++i) fRes += a_afArg[i];
114 return (
value_type)(1+(v*std::rand()/(RAND_MAX+1.0)));
119 return (
value_type)( 1 + (1000.0f * std::rand() / (RAND_MAX + 1.0) ) );
150 return val + v2 + v3;
ParserError exception_type
Type of the error class.
Test cases for unit testing.
static value_type f2of4(value_type, value_type v, value_type, value_type)
static value_type ValueOf(const char_type *)
static value_type Sum(const value_type *a_afArg, int a_iArgc)
static value_type f2of3(value_type, value_type v, value_type)
static value_type StrFun3(const char_type *v1, value_type v2, value_type v3)
std::vector< testfun_type > m_vTestFun
static value_type Mega(value_type a_fVal)
void Abort() const
Internal error in test class Test is going to be aborted.
static value_type Min(value_type a_fVal1, value_type a_fVal2)
int(ParserTester::* testfun_type)()
int ThrowTest(const string_type &a_str, int a_iErrc, bool a_bFail=true)
int EqnTestInt(const string_type &a_str, double a_fRes, bool a_fPass)
static value_type add(value_type v1, value_type v2)
static value_type f4of5(value_type, value_type, value_type, value_type v, value_type)
static value_type Micro(value_type a_fVal)
static value_type f3of3(value_type, value_type, value_type v)
static value_type FirstArg(const value_type *a_afArg, int a_iArgc)
static value_type plus2(value_type v1)
static value_type land(value_type v1, value_type v2)
static value_type times3(value_type v1)
static value_type RndWithString(const char_type *)
static value_type LastArg(const value_type *a_afArg, int a_iArgc)
static value_type Rnd(value_type v)
static value_type f2of2(value_type, value_type v)
static value_type f4of4(value_type, value_type, value_type, value_type v)
static value_type Milli(value_type a_fVal)
static value_type f1of4(value_type v, value_type, value_type, value_type)
static value_type Max(value_type a_fVal1, value_type a_fVal2)
static value_type sign(value_type v)
void AddTest(testfun_type a_pFun)
int EqnTest(const string_type &a_str, double a_fRes, bool a_fPass)
Evaluate a tet expression.
static value_type f3of4(value_type, value_type, value_type v, value_type)
static value_type f2of5(value_type, value_type v, value_type, value_type, value_type)
int EqnTestWithVarChange(const string_type &a_str, double a_fRes1, double a_fVar1, double a_fRes2, double a_fVar2)
Evaluate a tet expression.
static value_type StrFun1(const char_type *v1)
int TestNames()
Check muParser name restriction enforcement.
static value_type f1of3(value_type v, value_type, value_type)
static value_type f1of1(value_type v)
static value_type f3of5(value_type, value_type, value_type v, value_type, value_type)
static value_type StrToFloat(const char_type *a_szMsg)
static value_type f5of5(value_type, value_type, value_type, value_type, value_type v)
static value_type f1of2(value_type v, value_type)
static value_type sqr(value_type v1)
static value_type f1of5(value_type v, value_type, value_type, value_type, value_type)
static value_type StrFun2(const char_type *v1, value_type v2)
static int IsHexVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal)
Definition of the standard floating point parser.
#define _nrT(x)
Activate this option in order to compile with OpenMP support.
Definition of a parser using integer value.
Namespace for mathematical applications.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
string_type::value_type char_type
The character type used by the 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.
std::string string_type
The stringtype used by the parser.