|
void | initializeOnce () |
|
SOFA_TESTING_API void | init () |
| Initialize the Sofa.Testing library, as well as its dependencies. More...
|
|
SOFA_TESTING_API bool | isInitialized () |
| Return true if and only if theSofa.Testing library has been initialized. More...
|
|
SOFA_TESTING_API void | cleanup () |
| Clean up the resources used by the Sofa.Testing library, as well as its dependencies: SofaDefaultType, SofaHelper. More...
|
|
SOFA_TESTING_API bool | isCleanedUp () |
| Return true if and only if the Sofa.Testing library has been cleaned up. More...
|
|
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::type::Quat< SReal > &rot) |
|
template<class DataTypes > |
DataTypes::Coord | createCoord (const sofa::type::Vec3 &pos, const sofa::type::Quat< SReal > &rot) |
| Create a coord of the specified type from a Vec3 and a Quater. More...
|
|
template<sofa::Size N, class real > |
void | EXPECT_VEC_DOUBLE_EQ (sofa::type::Vec< N, real > const &expected, sofa::type::Vec< N, real > const &actual) |
|
template<sofa::Size L, sofa::Size C, class real > |
void | EXPECT_MAT_DOUBLE_EQ (sofa::type::Mat< L, C, real > const &expected, sofa::type::Mat< L, C, real > const &actual) |
|
template<sofa::Size L, sofa::Size C, class real > |
void | EXPECT_MAT_NEAR (sofa::type::Mat< L, C, real > const &expected, sofa::type::Mat< L, C, real > const &actual, real abs_error) |
|
std::unique_ptr< ScopedPlugin > | makeScopedPlugin (const std::initializer_list< std::string > &pluginNames) |
|
This file organization:
- PRIVATE DECLARATION (the class that are only used internally)
- PRIVATE DEFINITION (the implementation of the private classes)
- PUBLIC DEFINITION (the implementation of the public classes)
This file is providing an API to combine gtest and msg_* API. The underlying idea is to be able to test sofa's message.
The API is composed of two macro:
- EXPECT_MSG_EMIT(...);
- EXPECT_MSG_NOEMIT(...);
The first one generates a gtest failure when a message of a given type is not emitted. So You need to use it express that the good behavior from the object is to rise a message.
The second one generates a gtest failure when a message of a given type is emitted.
Examples of use: for(BaseLoader* b : objectlist) { EXPECT_MESSAGE_NOEMIT(Warning); EXPECT_MESSAGE_EMIT(Error); b->load("Invalid file"); }
To work the API need to a specific handler to be install in the messaging system. This means that we need to install the message handler using. This is not done automatically To not add something with a linear time complexity in the process.
Example of installation: MessageDispatcher::addHandler( MainGtestMessageHandler::getInstance() ) ;
NB: This is done automatically if you are inhering from Sofa_test.