Git Product home page Git Product logo

Comments (8)

traversaro avatar traversaro commented on July 16, 2024

Not sure, but perhaps that macro was supposed to just be a backward compatibility layer and meant to be deprecated: #34 .

from robot-testing-framework.

pattacini avatar pattacini commented on July 16, 2024

If I'm not mistaken, its use is quite spread at least in vvv-school. Unable to check right now.

from robot-testing-framework.

pattacini avatar pattacini commented on July 16, 2024

Apparently, I was wrong saying the macro is used in vvv-school. I've just checked and it's never used, instead.

However, icub-tests make use of it quite extensively. To this end, try out this search.

from robot-testing-framework.

apaikan avatar apaikan commented on July 16, 2024

@aerydna : Please pay attention that "RTF_TEST_FAIL_IF" fails if the condition is not hold! This standard has been chosen according to CppUnit testing framework!
According to its documentation:

/** Conditional failure report. RTF_TEST_FAIL_IF does not throw any
 *  exception. It reports a failure message to the TestResult indiecating
 *  that the check on the corresponding condition evaluates to \c false.
 * \ingroup Test Assertions
 * \param message Message to be reported as the detail of TestMessage
 * \param condition If this condition evaluates to \c false then the
 *                  test failed.
 *
 * \note RTF_TEST_FAIL_IF throws error exception if it is not called
 *       within a TestCase class.
 */

from robot-testing-framework.

aerydna avatar aerydna commented on July 16, 2024

@apaikan is there a CppUnit equivalent of RTF_TEST_FAIL_IF? is the signature similar? because as it is (with a IF) i tend to give the macro the following meaning:

RTF_TEST_FAIL_IF(condition)

==

if (condition)
{
    fail();
}

from robot-testing-framework.

apaikan avatar apaikan commented on July 16, 2024

@aerydna: Agree with you! I guess my confusion came from the implementation of CPPUNIT_ASSERT macro:

#define CPPUNIT_ASSERT ( condition ) 	
( CPPUNIT_NS::Asserter::failIf( !(condition),                                    \
                                 CPPUNIT_NS::Message( "assertion failed",         \
                                                      "Expression: " #condition),  \
                                 CPPUNIT_SOURCELINE() ) )

Please go ahead to change the the condition inside. If you are eager to do that, please remember to

  • Update the documentation (doxygen)
  • Check if there is any example regarding that which need to be updated
  • and more importantly, where it has been used in the bindings (Lua, Python, Ruby, Ada,..)

from robot-testing-framework.

pattacini avatar pattacini commented on July 16, 2024

@aerydna please remember to notify me when such changes happen, 'cause #84 is not only related to RTF_TEST_FAIL_IF as discussed here but also to e.g. RTF_ASSERT_ERROR_IF for which, instead, we'll have an impact on vvv-school code I'm maintaining.

Honestly, I don't like to discover this by myself: I could easily miss reading PR for example 😉

from robot-testing-framework.

pattacini avatar pattacini commented on July 16, 2024

More on this: icub-tests needs to be updated now.

@aerydna is this action already planned?

from robot-testing-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.