robotology / robot-testing-framework

Robot Testing Framework (RTF)
http://robotology.github.io/robot-testing-framework/index.html
GNU Lesser General Public License v2.1
19 stars 11 forks source link

REPORT macro requires { } brackets #36

Closed barbalberto closed 8 years ago

barbalberto commented 8 years ago

This code

    if(true)
        RTF_TEST_REPORT(Asserter::format("Starting with SystemClock"));
    else
        RTF_TEST_REPORT(Asserter::format("Starting with Network Clock from port %s", clockPort_EnvName.c_str()));

Give this compilation error:

In member function ‘virtual void ClockTest::run()’:
/usr/local/src/robot/icub-src/icub-tests/src/clock/ClockTest.cpp:84:5: error: ‘else’ without a previous ‘if’
     else
     ^

While using brackets it works fine

   if(true)
    {  RTF_TEST_REPORT(Asserter::format("Starting with SystemClock"));   }
    else
    {   RTF_TEST_REPORT(Asserter::format("Starting with Network Clock from port %s", clockPort_EnvName.c_str()));  }