SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::helper::testing Namespace Reference

Classes

class  BaseSimulationTest
 
class  BaseTest
 Base class for Sofa test fixtures. More...
 
struct  data_traits
 
struct  NumericTest
 Helper functions to compare scalars, vectors, matrices, etc. More...
 
struct  setRotWrapper
 
struct  setRotWrapper< DataTypes, 2, false >
 
struct  setRotWrapper< DataTypes, N, false >
 
struct  setRotWrapper< DataTypes, N, true >
 

Functions

void initializeOnce ()
 
template<class Vector , class ReadData >
void copyFromData (Vector &v, const ReadData &d)
 Resize the Vector and copy it from the Data. More...
 
template<class WriteData , class Vector >
void copyToData (WriteData &d, const Vector &v)
 Copy the Vector to the Data. They must have the same size. More...
 
template<class DataTypes >
void setRot (typename DataTypes::Coord &coord, const sofa::helper::Quater< SReal > &rot)
 
template<class DataTypes >
DataTypes::Coord createCoord (const sofa::defaulttype::Vector3 &pos, const sofa::helper::Quater< SReal > &rot)
 Create a coord of the specified type from a Vector3 and a Quater. More...
 
template<int N, class real >
void EXPECT_VEC_DOUBLE_EQ (sofa::defaulttype::Vec< N, real > const &expected, sofa::defaulttype::Vec< N, real > const &actual)
 
template<int L, int C, class real >
void EXPECT_MAT_DOUBLE_EQ (sofa::defaulttype::Mat< L, C, real > const &expected, sofa::defaulttype::Mat< L, C, real > const &actual)
 
template<int L, int C, class real >
void EXPECT_MAT_NEAR (sofa::defaulttype::Mat< L, C, real > const &expected, sofa::defaulttype::Mat< L, C, real > const &actual, real abs_error)
 

Variables

const SReal g_minDeltaErrorRatio = .1
 acceptable ratio between finite difference delta and error threshold More...
 

Function Documentation

template<class Vector , class ReadData >
void sofa::helper::testing::copyFromData ( Vector &  v,
const ReadData &  d 
)

Resize the Vector and copy it from the Data.

template<class WriteData , class Vector >
void sofa::helper::testing::copyToData ( WriteData &  d,
const Vector &  v 
)

Copy the Vector to the Data. They must have the same size.

template<class DataTypes >
DataTypes::Coord sofa::helper::testing::createCoord ( const sofa::defaulttype::Vector3 &  pos,
const sofa::helper::Quater< SReal > &  rot 
)

Create a coord of the specified type from a Vector3 and a Quater.

template<int L, int C, class real >
void sofa::helper::testing::EXPECT_MAT_DOUBLE_EQ ( sofa::defaulttype::Mat< L, C, real > const &  expected,
sofa::defaulttype::Mat< L, C, real > const &  actual 
)
template<int L, int C, class real >
void sofa::helper::testing::EXPECT_MAT_NEAR ( sofa::defaulttype::Mat< L, C, real > const &  expected,
sofa::defaulttype::Mat< L, C, real > const &  actual,
real  abs_error 
)
template<int N, class real >
void sofa::helper::testing::EXPECT_VEC_DOUBLE_EQ ( sofa::defaulttype::Vec< N, real > const &  expected,
sofa::defaulttype::Vec< N, real > const &  actual 
)
void sofa::helper::testing::initializeOnce ( )
template<class DataTypes >
void sofa::helper::testing::setRot ( typename DataTypes::Coord &  coord,
const sofa::helper::Quater< SReal > &  rot 
)

Variable Documentation

const SReal sofa::helper::testing::g_minDeltaErrorRatio = .1

acceptable ratio between finite difference delta and error threshold