Closed traversaro closed 8 years ago
I think the right way to have gtest-like functionality is to use gtest :)
The main problems for using directly GTest, beside the problems of dependency handling (that are not trivial, especially on windows) are:
In the end, given that this approximal equality helpers can be written in probably 10 lines of code, we have to consider that the "Not Invented Here Syndrome" is a problem, but another risk is to always try to rely on external dependencies, even if sometimes the simplest and more manteinable way of doing things is an ad-hoc solution.
Agree with @traversaro . We can provide more basic checking and assertion macros/function. They are pretty easy to implement (some useful cppuint macros can be found here http://cppunit.sourceforge.net/doc/cvs/group___assertions.html) .
icub-tests
or equivalent tests repository. A new class (RTF::YARP::YarpTestAsserter
) has been added within the RTF_yarp_utility
library which aggregates some of the auxiliary checker functions (e.g., YarpTestAsserter::isApproxEqual
).
We can collect more helper functions as we need in future.
We need some helpers for testing approximate equality of floating point values.
An important feature to have is to print the values when the comparison fails, for easy debugging of failing tests (as in gtest
EXPECT_NEAR
,ASSERT_NEAR
in https://code.google.com/p/googletest/wiki/AdvancedGuide ),