SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
slide::tests Namespace Reference

Namespaces

namespace  unit
 

Functions

bool TEST (auto &&fun, auto &&fun_name)
 Test function wrapper. More...
 
bool NEAR (auto x1, auto x2, double abs_error=1e-15)
 Check if two values are nearly equal within a given absolute error. More...
 
bool EQ (double x1, double x2)
 Check if two doubles are equal (wrapper for NEAR function). More...
 

Variables

constexpr bool DEBUG_TESTS = false
 

Function Documentation

◆ EQ()

bool slide::tests::EQ ( double  x1,
double  x2 
)

Check if two doubles are equal (wrapper for NEAR function).

Parameters
x1First double value to compare.
x2Second double value to compare.
Returns
true if the values are equal, false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NEAR()

bool slide::tests::NEAR ( auto  x1,
auto  x2,
double  abs_error = 1e-15 
)

Check if two values are nearly equal within a given absolute error.

Parameters
x1First value to compare.
x2Second value to compare.
abs_errorThe allowed absolute error between the two values (default: 1e-15).
Returns
true if the values are nearly equal, false otherwise.
Here is the caller graph for this function:

◆ TEST()

bool slide::tests::TEST ( auto &&  fun,
auto &&  fun_name 
)

Test function wrapper.

Parameters
funFunction to be tested.
fun_nameName of the function to be tested.
Returns
true if the test passes, false if it fails or an exception is caught.
Here is the caller graph for this function:

Variable Documentation

◆ DEBUG_TESTS

constexpr bool slide::tests::DEBUG_TESTS = false
constexpr