LMMS
Loading...
Searching...
No Matches
exprtk_test.cpp File Reference
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <numeric>
#include <string>
#include <vector>
#include "exprtk.hpp"

Classes

struct  edge_cases< T >
struct  edge_cases< float >
struct  edge_cases< double >
struct  test_xy< T >
struct  test_xyzw< T >
struct  test_ab< T >
struct  exprtk_test_final< T >
struct  base_func< T >
struct  exprtk_test_final< T >::test_result_t
struct  vector_access_rtc_counter
class  vv_size_handler_t< T >
struct  type_name< T >
struct  type_name< float >
struct  type_name< double >
struct  type_name< long double >

Macros

#define exprtk_test_override
#define exprtk_test_final
#define exprtk_test_delete
#define define_free_functions(N, Type)
#define pb(v, N)
#define pb(v, N)
#define pb(v, N)
#define pb(v, N)
#define perform_test(Type, Number)

Typedefs

typedef double numeric_type
typedef std::pair< std::string, numeric_typetest_t

Functions

template<typename T>
bool not_equal_impl (const T &t1, const T &t2, const T &epsilon=0.0000000001)
template<typename T>
bool not_equal (const T &t0, const T &t1, const T &epsilon=T(0.0000000001))
bool not_equal (const float &t0, const float &t1, const float &epsilon=0.000001f)
template<typename T>
bool test_expression (const std::string &expression_string, const T &expected_result)
template<typename T>
bool run_test00 ()
template<typename T>
bool run_test01 ()
template<typename T>
bool run_test02 ()
template<typename T>
bool run_test03 ()
template<typename T>
clamp (const T &l, const T &v, const T &u)
template<typename T>
bool run_test04 ()
template<typename T>
bool run_test05 ()
template<typename T>
bool run_test06 ()
template<typename T>
bool run_test07 ()
template<typename T>
bool run_test08 ()
 define_free_functions (foo, numeric_type) template< typename T > bool run_test09()
template<typename T>
bool run_test10 ()
template<typename T>
bool run_test11 ()
template<typename T>
bool run_test12 ()
template<typename T>
bool run_test13 ()
template<typename Allocator, template< typename, typename > class Sequence>
std::size_t load_expressions (const std::string &file_name, Sequence< std::string, Allocator > &sequence)
template<typename T>
bool run_test14 ()
template<typename T>
bool run_test15 ()
template<typename T>
bool run_test16 ()
template<typename T>
bool run_test17 ()
template<typename T>
bool run_test18 ()
template<typename T>
bool run_test19 ()
template<typename T>
bool run_test20 ()
template<typename T>
std::string results_to_string (const exprtk::results_context< T > &results)
template<typename T>
bool result_equal (const exprtk::results_context< T > &results, const T &value)
template<typename T>
bool run_test21 ()
template<typename T>
bool run_test22 ()
int main (int argc, char *argv[])

Variables

static const test_t global_test_list []
static const std::size_t global_test_list_size = sizeof(global_test_list) / sizeof(test_t)

Macro Definition Documentation

◆ define_free_functions

#define define_free_functions ( N,
Type )
Value:
inline Type N##1(Type v0) { return v0; } \
inline Type N##2(Type v0, Type v1) { return v0 + v1; } \
inline Type N##3(Type v0, Type v1, Type v2) { return v0 + v1 + v2; } \
inline Type N##4(Type v0, Type v1, Type v2, Type v3) { return v0 + v1 + v2 + v3; } \
inline Type N##5(Type v0, Type v1, Type v2, Type v3, Type v4) { return v0 + v1 + v2 + v3 + v4; } \
inline Type N##6(Type v0, Type v1, Type v2, Type v3, Type v4, Type v5) { return v0 + v1 + v2 + v3 + v4 + v5; } \
static void v2(register WDL_FFT_REAL *a)
Definition fft.c:1099
Type
Definition Lv2Ports.h:60
#define N
Definition nseel-cfunc.c:36

◆ exprtk_test_delete

#define exprtk_test_delete

◆ exprtk_test_final

#define exprtk_test_final

◆ exprtk_test_override

#define exprtk_test_override

◆ pb [1/4]

#define pb ( v,
N )
Value:
v.push_back(T(N)); \
unsigned v[N_MAX]
Definition inflate.c:1584

◆ pb [2/4]

#define pb ( v,
N )
Value:
v.push_back(T(N)); \

◆ pb [3/4]

#define pb ( v,
N )
Value:
v.push_back(T(N)); \

◆ pb [4/4]

#define pb ( v,
N )
Value:
v.push_back(T(N)); \

◆ perform_test

#define perform_test ( Type,
Number )
Value:
{ \
const std::string test_name = "run_test"#Number; \
if ( \
test_set.empty() || \
test_set.find(test_name) != std::string::npos \
) \
{ \
exprtk::timer timer; \
timer.start(); \
if (!run_test##Number<Type>()) \
{ \
printf("run_test"#Number" (%s) *** FAILED! ***\n", \
type_name<Type>::value().c_str()); \
} \
else \
{ \
timer.stop(); \
printf("run_test"#Number" (%s) - Result: SUCCESS Time: %8.4fsec\n", \
timer.time()); \
} \
} \
} \
#define EXIT_FAILURE
Definition jerror.c:32
static std::string value()
Definition exprtk_test.cpp:12802
int result
Definition process.c:1455

Typedef Documentation

◆ numeric_type

typedef double numeric_type

◆ test_t

typedef std::pair<std::string,numeric_type> test_t

Function Documentation

◆ clamp()

template<typename T>
T clamp ( const T & l,
const T & v,
const T & u )
inline

◆ define_free_functions()

define_free_functions ( foo ,
numeric_type  )

◆ load_expressions()

template<typename Allocator, template< typename, typename > class Sequence>
std::size_t load_expressions ( const std::string & file_name,
Sequence< std::string, Allocator > & sequence )
inline

◆ main()

int main ( int argc,
char * argv[] )

◆ not_equal() [1/2]

bool not_equal ( const float & t0,
const float & t1,
const float & epsilon = 0.000001f )
inline

◆ not_equal() [2/2]

template<typename T>
bool not_equal ( const T & t0,
const T & t1,
const T & epsilon = T(0.0000000001) )
inline

◆ not_equal_impl()

template<typename T>
bool not_equal_impl ( const T & t1,
const T & t2,
const T & epsilon = 0.0000000001 )
inline

◆ result_equal()

template<typename T>
bool result_equal ( const exprtk::results_context< T > & results,
const T & value )
inline

◆ results_to_string()

template<typename T>
std::string results_to_string ( const exprtk::results_context< T > & results)
inline

◆ run_test00()

template<typename T>
bool run_test00 ( )

◆ run_test01()

template<typename T>
bool run_test01 ( )

◆ run_test02()

template<typename T>
bool run_test02 ( )

◆ run_test03()

template<typename T>
bool run_test03 ( )

◆ run_test04()

template<typename T>
bool run_test04 ( )

◆ run_test05()

template<typename T>
bool run_test05 ( )

◆ run_test06()

template<typename T>
bool run_test06 ( )

◆ run_test07()

template<typename T>
bool run_test07 ( )

◆ run_test08()

template<typename T>
bool run_test08 ( )

◆ run_test10()

template<typename T>
bool run_test10 ( )

◆ run_test11()

template<typename T>
bool run_test11 ( )

◆ run_test12()

template<typename T>
bool run_test12 ( )

◆ run_test13()

template<typename T>
bool run_test13 ( )

◆ run_test14()

template<typename T>
bool run_test14 ( )

◆ run_test15()

template<typename T>
bool run_test15 ( )

◆ run_test16()

template<typename T>
bool run_test16 ( )

◆ run_test17()

template<typename T>
bool run_test17 ( )

◆ run_test18()

template<typename T>
bool run_test18 ( )

◆ run_test19()

template<typename T>
bool run_test19 ( )

◆ run_test20()

template<typename T>
bool run_test20 ( )

◆ run_test21()

template<typename T>
bool run_test21 ( )

◆ run_test22()

template<typename T>
bool run_test22 ( )

◆ test_expression()

template<typename T>
bool test_expression ( const std::string & expression_string,
const T & expected_result )
inline

Variable Documentation

◆ global_test_list

const test_t global_test_list[]
static

◆ global_test_list_size

const std::size_t global_test_list_size = sizeof(global_test_list) / sizeof(test_t)
static