NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
mu::Test::ParserTester Class Reference

Search Toolkit Book for mu::Test::ParserTester

Test cases for unit testing. More...

#include <gui/utils/muparser/muParserTest.h>

+ Collaboration diagram for mu::Test::ParserTester:

Public Types

typedef int(ParserTester::* testfun_type) ()
 

Public Member Functions

 ParserTester ()
 
void Run ()
 

Private Member Functions

int TestNames ()
 Check muParser name restriction enforcement. More...
 
int TestSyntax ()
 
int TestMultiArg ()
 
int TestVolatile ()
 Test volatile (nonoptimizeable functions). More...
 
int TestPostFix ()
 
int TestExpression ()
 
int TestInfixOprt ()
 
int TestBinOprt ()
 
int TestVarConst ()
 
int TestInterface ()
 
int TestException ()
 
int TestStrArg ()
 
void Abort () const
 Internal error in test class Test is going to be aborted. More...
 
void AddTest (testfun_type a_pFun)
 
int EqnTest (const string_type &a_str, double a_fRes, bool a_fPass)
 Evaluate a tet expression. More...
 
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 Private Member Functions

static value_type f1of1 (value_type v)
 
static value_type f1of2 (value_type v, value_type)
 
static value_type f2of2 (value_type, value_type v)
 
static value_type f1of3 (value_type v, value_type, value_type)
 
static value_type f2of3 (value_type, value_type v, value_type)
 
static value_type f3of3 (value_type, value_type, value_type v)
 
static value_type f1of4 (value_type v, value_type, value_type, value_type)
 
static value_type f2of4 (value_type, value_type v, value_type, value_type)
 
static value_type f3of4 (value_type, value_type, value_type v, value_type)
 
static value_type f4of4 (value_type, value_type, value_type, value_type v)
 
static value_type f1of5 (value_type v, value_type, value_type, value_type, value_type)
 
static value_type f2of5 (value_type, value_type v, value_type, value_type, value_type)
 
static value_type f3of5 (value_type, value_type, value_type v, value_type, value_type)
 
static value_type f4of5 (value_type, value_type, value_type, value_type v, value_type)
 
static value_type f5of5 (value_type, value_type, value_type, value_type, value_type v)
 
static value_type Min (value_type a_fVal1, value_type a_fVal2)
 
static value_type Max (value_type a_fVal1, value_type a_fVal2)
 
static value_type plus2 (value_type v1)
 
static value_type times3 (value_type v1)
 
static value_type sqr (value_type v1)
 
static value_type sign (value_type v)
 
static value_type FirstArg (const value_type *a_afArg, int a_iArgc)
 
static value_type LastArg (const value_type *a_afArg, int a_iArgc)
 
static value_type Sum (const value_type *a_afArg, int a_iArgc)
 
static value_type Rnd (value_type v)
 
static value_type RndWithString (const char_type *)
 
static value_type Ping ()
 
static value_type ValueOf (const char_type *)
 
static value_type StrFun1 (const char_type *v1)
 
static value_type StrFun2 (const char_type *v1, value_type v2)
 
static value_type StrFun3 (const char_type *v1, value_type v2, value_type v3)
 
static value_type StrToFloat (const char_type *a_szMsg)
 
static value_type Milli (value_type v)
 

Private Attributes

std::vector< testfun_typem_vTestFun
 

Static Private Attributes

static int c_iCount = 0
 

Detailed Description

Test cases for unit testing.

(C) 2004-2006 Ingo Berg

Definition at line 49 of file muParserTest.h.

Member Typedef Documentation

◆ testfun_type

typedef int(ParserTester::* mu::Test::ParserTester::testfun_type) ()

Definition at line 179 of file muParserTest.h.

Constructor & Destructor Documentation

◆ ParserTester()

mu::Test::ParserTester::ParserTester ( )

Member Function Documentation

◆ Abort()

void mu::Test::ParserTester::Abort ( void  ) const
private

Internal error in test class Test is going to be aborted.

Definition at line 1158 of file muParserTest.cpp.

References mu::console(), exit(), and wxT.

Referenced by Run().

◆ AddTest()

void mu::Test::ParserTester::AddTest ( testfun_type  a_pFun)
private

Definition at line 869 of file muParserTest.cpp.

References m_vTestFun.

Referenced by ParserTester().

◆ EqnTest()

int mu::Test::ParserTester::EqnTest ( const string_type a_str,
double  a_fRes,
bool  a_fPass 
)
private

◆ EqnTestInt()

int mu::Test::ParserTester::EqnTestInt ( const string_type a_str,
double  a_fRes,
bool  a_fPass 
)
private

◆ f1of1()

static value_type mu::Test::ParserTester::f1of1 ( value_type  v)
inlinestaticprivate

Definition at line 53 of file muParserTest.h.

Referenced by EqnTest(), and TestNames().

◆ f1of2()

static value_type mu::Test::ParserTester::f1of2 ( value_type  v,
value_type   
)
inlinestaticprivate

Definition at line 55 of file muParserTest.h.

Referenced by EqnTest(), and TestNames().

◆ f1of3()

static value_type mu::Test::ParserTester::f1of3 ( value_type  v,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 58 of file muParserTest.h.

Referenced by EqnTest().

◆ f1of4()

static value_type mu::Test::ParserTester::f1of4 ( value_type  v,
value_type  ,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 62 of file muParserTest.h.

Referenced by EqnTest().

◆ f1of5()

static value_type mu::Test::ParserTester::f1of5 ( value_type  v,
value_type  ,
value_type  ,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 67 of file muParserTest.h.

Referenced by EqnTest().

◆ f2of2()

static value_type mu::Test::ParserTester::f2of2 ( value_type  ,
value_type  v 
)
inlinestaticprivate

Definition at line 56 of file muParserTest.h.

Referenced by EqnTest().

◆ f2of3()

static value_type mu::Test::ParserTester::f2of3 ( value_type  ,
value_type  v,
value_type   
)
inlinestaticprivate

Definition at line 59 of file muParserTest.h.

Referenced by EqnTest().

◆ f2of4()

static value_type mu::Test::ParserTester::f2of4 ( value_type  ,
value_type  v,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 63 of file muParserTest.h.

Referenced by EqnTest().

◆ f2of5()

static value_type mu::Test::ParserTester::f2of5 ( value_type  ,
value_type  v,
value_type  ,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 68 of file muParserTest.h.

Referenced by EqnTest().

◆ f3of3()

static value_type mu::Test::ParserTester::f3of3 ( value_type  ,
value_type  ,
value_type  v 
)
inlinestaticprivate

Definition at line 60 of file muParserTest.h.

Referenced by EqnTest().

◆ f3of4()

static value_type mu::Test::ParserTester::f3of4 ( value_type  ,
value_type  ,
value_type  v,
value_type   
)
inlinestaticprivate

Definition at line 64 of file muParserTest.h.

Referenced by EqnTest().

◆ f3of5()

static value_type mu::Test::ParserTester::f3of5 ( value_type  ,
value_type  ,
value_type  v,
value_type  ,
value_type   
)
inlinestaticprivate

Definition at line 69 of file muParserTest.h.

Referenced by EqnTest().

◆ f4of4()

static value_type mu::Test::ParserTester::f4of4 ( value_type  ,
value_type  ,
value_type  ,
value_type  v 
)
inlinestaticprivate

Definition at line 65 of file muParserTest.h.

Referenced by EqnTest().

◆ f4of5()

static value_type mu::Test::ParserTester::f4of5 ( value_type  ,
value_type  ,
value_type  ,
value_type  v,
value_type   
)
inlinestaticprivate

Definition at line 70 of file muParserTest.h.

Referenced by EqnTest().

◆ f5of5()

static value_type mu::Test::ParserTester::f5of5 ( value_type  ,
value_type  ,
value_type  ,
value_type  ,
value_type  v 
)
inlinestaticprivate

Definition at line 71 of file muParserTest.h.

Referenced by EqnTest().

◆ FirstArg()

static value_type mu::Test::ParserTester::FirstArg ( const value_type a_afArg,
int  a_iArgc 
)
inlinestaticprivate

Definition at line 81 of file muParserTest.h.

References MUP_T.

Referenced by EqnTest().

◆ LastArg()

static value_type mu::Test::ParserTester::LastArg ( const value_type a_afArg,
int  a_iArgc 
)
inlinestaticprivate

Definition at line 89 of file muParserTest.h.

References MUP_T.

Referenced by EqnTest().

◆ Max()

static value_type mu::Test::ParserTester::Max ( value_type  a_fVal1,
value_type  a_fVal2 
)
inlinestaticprivate

Definition at line 74 of file muParserTest.h.

Referenced by EqnTest().

◆ Milli()

static value_type mu::Test::ParserTester::Milli ( value_type  v)
inlinestaticprivate

Definition at line 159 of file muParserTest.h.

Referenced by EqnTest().

◆ Min()

static value_type mu::Test::ParserTester::Min ( value_type  a_fVal1,
value_type  a_fVal2 
)
inlinestaticprivate

Definition at line 73 of file muParserTest.h.

Referenced by EqnTest().

◆ Ping()

static value_type mu::Test::ParserTester::Ping ( )
inlinestaticprivate

Definition at line 117 of file muParserTest.h.

Referenced by EqnTest(), and ThrowTest().

◆ plus2()

static value_type mu::Test::ParserTester::plus2 ( value_type  v1)
inlinestaticprivate

Definition at line 76 of file muParserTest.h.

Referenced by EqnTest().

◆ Rnd()

static value_type mu::Test::ParserTester::Rnd ( value_type  v)
inlinestaticprivate

Definition at line 107 of file muParserTest.h.

Referenced by TestVolatile().

◆ RndWithString()

static value_type mu::Test::ParserTester::RndWithString ( const char_type )
inlinestaticprivate

Definition at line 112 of file muParserTest.h.

Referenced by TestVolatile().

◆ Run()

void mu::Test::ParserTester::Run ( void  )

◆ sign()

static value_type mu::Test::ParserTester::sign ( value_type  v)
inlinestaticprivate

Definition at line 79 of file muParserTest.h.

Referenced by EqnTest().

◆ sqr()

static value_type mu::Test::ParserTester::sqr ( value_type  v1)
inlinestaticprivate

Definition at line 78 of file muParserTest.h.

Referenced by EqnTest().

◆ StrFun1()

static value_type mu::Test::ParserTester::StrFun1 ( const char_type v1)
inlinestaticprivate

Definition at line 127 of file muParserTest.h.

References val.

Referenced by EqnTest(), and ThrowTest().

◆ StrFun2()

static value_type mu::Test::ParserTester::StrFun2 ( const char_type v1,
value_type  v2 
)
inlinestaticprivate

Definition at line 134 of file muParserTest.h.

References v2, and val.

Referenced by EqnTest(), and ThrowTest().

◆ StrFun3()

static value_type mu::Test::ParserTester::StrFun3 ( const char_type v1,
value_type  v2,
value_type  v3 
)
inlinestaticprivate

Definition at line 141 of file muParserTest.h.

References v2, and val.

Referenced by EqnTest(), and ThrowTest().

◆ StrToFloat()

static value_type mu::Test::ParserTester::StrToFloat ( const char_type a_szMsg)
inlinestaticprivate

Definition at line 148 of file muParserTest.h.

References val.

Referenced by EqnTest().

◆ Sum()

static value_type mu::Test::ParserTester::Sum ( const value_type a_afArg,
int  a_iArgc 
)
inlinestaticprivate

Definition at line 97 of file muParserTest.h.

References i, and MUP_T.

Referenced by EqnTest().

◆ TestBinOprt()

int mu::Test::ParserTester::TestBinOprt ( )
private

Definition at line 137 of file muParserTest.cpp.

References mu::console(), EqnTest(), EqnTestInt(), and wxT.

Referenced by ParserTester().

◆ TestException()

int mu::Test::ParserTester::TestException ( )
private

◆ TestExpression()

int mu::Test::ParserTester::TestExpression ( )
private

Definition at line 736 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestInfixOprt()

int mu::Test::ParserTester::TestInfixOprt ( )
private

Definition at line 549 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestInterface()

int mu::Test::ParserTester::TestInterface ( )
private

◆ TestMultiArg()

int mu::Test::ParserTester::TestMultiArg ( )
private

Definition at line 465 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestNames()

int mu::Test::ParserTester::TestNames ( )
private

Check muParser name restriction enforcement.

Definition at line 232 of file muParserTest.cpp.

References a, mu::ParserBase::ClearConst(), mu::console(), mu::ParserBase::EnableBuiltInOprt(), f1of1(), f1of2(), PARSER_THROWCHECK, and wxT.

Referenced by ParserTester().

◆ TestPostFix()

int mu::Test::ParserTester::TestPostFix ( )
private

Definition at line 608 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestStrArg()

int mu::Test::ParserTester::TestStrArg ( )
private

Definition at line 113 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestSyntax()

int mu::Test::ParserTester::TestSyntax ( )
private

Definition at line 333 of file muParserTest.cpp.

References mu::console(), EqnTest(), and wxT.

Referenced by ParserTester().

◆ TestVarConst()

int mu::Test::ParserTester::TestVarConst ( )
private

◆ TestVolatile()

int mu::Test::ParserTester::TestVolatile ( )
private

◆ ThrowTest()

int mu::Test::ParserTester::ThrowTest ( const string_type a_str,
int  a_iErrc,
bool  a_bFail = true 
)
private

◆ times3()

static value_type mu::Test::ParserTester::times3 ( value_type  v1)
inlinestaticprivate

Definition at line 77 of file muParserTest.h.

Referenced by EqnTest().

◆ ValueOf()

static value_type mu::Test::ParserTester::ValueOf ( const char_type )
inlinestaticprivate

Definition at line 122 of file muParserTest.h.

Referenced by EqnTest(), and ThrowTest().

Member Data Documentation

◆ c_iCount

int mu::Test::ParserTester::c_iCount = 0
staticprivate

Definition at line 161 of file muParserTest.h.

Referenced by EqnTest(), EqnTestInt(), ParserTester(), Run(), and ThrowTest().

◆ m_vTestFun

std::vector<testfun_type> mu::Test::ParserTester::m_vTestFun
private

Definition at line 185 of file muParserTest.h.

Referenced by AddTest(), and Run().


The documentation for this class was generated from the following files:
Modified on Fri Jan 05 07:25:54 2024 by modify_doxy.py rev. 669887