Classes | |
struct | SparseMatrixTest |
class | BaseSimulationTest |
class | BaseTest |
Base class for Sofa test fixtures. More... | |
struct | CleanupCheck |
class | LinearCongruentialRandomGenerator |
A simple deterministic and portable random number generator. More... | |
struct | NumericTest |
Helper functions to compare scalars, vectors, matrices, etc. More... | |
struct | data_traits |
struct | setRotWrapper |
struct | setRotWrapper< DataTypes, N, true > |
struct | setRotWrapper< DataTypes, 2, false > |
struct | setRotWrapper< DataTypes, N, false > |
class | GtestMessageFrame |
class | GtestMessageFrameFailure |
class | GtestMessageFrameFailureWhenMissing |
class | GtestMessageFrameIgnore |
class | GtestMessageHandler |
class | MainGtestMessageHandlerPrivate |
class | MessageAsTestFailure |
class | ExpectMessage |
class | IgnoreMessage |
class | MainGtestMessageHandler |
Functions | |
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) |
Variables | |
const SReal | g_minDeltaErrorRatio = .1 |
acceptable ratio between finite difference delta and error threshold More... | |
This file organization:
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:
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.
SOFA_TESTING_API void sofa::testing::cleanup | ( | ) |
Clean up the resources used by the Sofa.Testing library, as well as its dependencies: SofaDefaultType, SofaHelper.
void sofa::testing::copyFromData | ( | Vector & | v, |
const ReadData & | d | ||
) |
Resize the Vector and copy it from the Data.
void sofa::testing::copyToData | ( | WriteData & | d, |
const Vector & | v | ||
) |
Copy the Vector to the Data. They must have the same size.
DataTypes::Coord sofa::testing::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.
void sofa::testing::EXPECT_MAT_DOUBLE_EQ | ( | sofa::type::Mat< L, C, real > const & | expected, |
sofa::type::Mat< L, C, real > const & | actual | ||
) |
void sofa::testing::EXPECT_MAT_NEAR | ( | sofa::type::Mat< L, C, real > const & | expected, |
sofa::type::Mat< L, C, real > const & | actual, | ||
real | abs_error | ||
) |
void sofa::testing::EXPECT_VEC_DOUBLE_EQ | ( | sofa::type::Vec< N, real > const & | expected, |
sofa::type::Vec< N, real > const & | actual | ||
) |
SOFA_TESTING_API void sofa::testing::init | ( | ) |
Initialize the Sofa.Testing library, as well as its dependencies.
void sofa::testing::initializeOnce | ( | ) |
SOFA_TESTING_API bool sofa::testing::isCleanedUp | ( | ) |
Return true if and only if the Sofa.Testing library has been cleaned up.
SOFA_TESTING_API bool sofa::testing::isInitialized | ( | ) |
Return true if and only if theSofa.Testing library has been initialized.
void sofa::testing::setRot | ( | typename DataTypes::Coord & | coord, |
const sofa::type::Quat< SReal > & | rot | ||
) |
const SReal sofa::testing::g_minDeltaErrorRatio = .1 |
acceptable ratio between finite difference delta and error threshold