SOFA API  7dc68564
Open source framework for multi-physics simuation
sofa::DataEngine_test< DataEngineType > Struct Template Reference

#include <DataEngineTestCreation.h>

Helper for writing DataEngine tests. More...

Inheritance diagram for sofa::DataEngine_test< DataEngineType >:

Detailed Description

template<typename DataEngineType>
struct sofa::DataEngine_test< DataEngineType >

Helper for writing DataEngine tests.

Author
Matthieu Nesme, 2015

Public Attributes

Engine::SPtr m_engine
 the real tested engine More...
 
DataEngineType::SPtr m_engineInput
 an other identical engine, where only inputs are used (not the engine itself). It is an easy way to create all inputs of the right type, to be able to link with them. More...
 
- Public Attributes inherited from sofa::testing::BaseTest
sofa::testing::MessageAsTestFailure m_fatal
 
sofa::testing::MessageAsTestFailure m_error
 

Public Member Functions

 DataEngine_test ()
 
virtual void init ()
 
void run_basic_test ()
 
- Public Member Functions inherited from sofa::testing::BaseTest
 BaseTest ()
 Initialize Sofa and the random number generator. More...
 
 ~BaseTest () override
 
virtual void onSetUp ()
 
virtual void onTearDown ()
 

Additional Inherited Members

- Static Public Attributes inherited from sofa::testing::BaseTest
static int seed = (unsigned int)time(nullptr)
 Seed value. More...
 

Attribute details

◆ m_engine

template<typename DataEngineType >
Engine::SPtr sofa::DataEngine_test< DataEngineType >::m_engine

the real tested engine

◆ m_engineInput

template<typename DataEngineType >
DataEngineType::SPtr sofa::DataEngine_test< DataEngineType >::m_engineInput

an other identical engine, where only inputs are used (not the engine itself). It is an easy way to create all inputs of the right type, to be able to link with them.

Constructor details

◆ DataEngine_test()

template<typename DataEngineType >
sofa::DataEngine_test< DataEngineType >::DataEngine_test ( )
inline

Function details

◆ init()

template<typename DataEngineType >
virtual void sofa::DataEngine_test< DataEngineType >::init ( void  )
inlinevirtual

◆ run_basic_test()

template<typename DataEngineType >
void sofa::DataEngine_test< DataEngineType >::run_basic_test ( )
inline

Testing the number of call to the DataEngine::update() function

Warning
DO NOT test the values computed by the engine To do so, you can inherit this class and add a test function that takes inputs and outputs to test