Skip to content

Commit

Permalink
tests: moved operation caller checks from OperationCallerComponent co…
Browse files Browse the repository at this point in the history
…nstructor to ready() member function

... so that it can be reused in corba_ipc_server without having initialized the Boost Test framework.

This is a regression from 167076a.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
  • Loading branch information
meyerj committed Feb 3, 2016
1 parent 167076a commit c005354
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion tests/corba_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class CorbaTest : public OperationsFixture
pint1("pint1", "", 3), pdouble1(new Property<double>("pdouble1", "", -3.0)),
aint1(3), adouble1(-3.0), wait(0)
{
// connect DataPorts
// check operations (moved from OperationCallerComponent constructor for reuseability in corba-ipc-server)
BOOST_REQUIRE( caller->ready() );

// connect DataPorts
mi1 = new InputPort<double> ("mi");
mo1 = new OutputPort<double> ("mo");

Expand Down
16 changes: 11 additions & 5 deletions tests/operations_fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ class OperationCallerComponent : public TaskContext
opc3 = tc->provides("methods")->getOperation("m3");
opc3.setCaller( this->engine() );

BOOST_REQUIRE( opc0.ready() );
BOOST_REQUIRE( opc1.ready() );
BOOST_REQUIRE( opc2.ready() );
BOOST_REQUIRE( opc3.ready() );

// four combinations are possible:
this->addOperation("o0", &OperationCallerComponent::m0, this, OwnThread);
this->addOperation("o1", &OperationCallerComponent::m1, this, ClientThread);
Expand All @@ -71,6 +66,17 @@ class OperationCallerComponent : public TaskContext
// but do set the caller to this component.
}

bool ready() {
BOOST_REQUIRE( opc0.ready() );
BOOST_REQUIRE( opc1.ready() );
BOOST_REQUIRE( opc2.ready() );
BOOST_REQUIRE( opc3.ready() );
return opc0.ready() &&
opc1.ready() &&
opc2.ready() &&
opc3.ready();
}

// plain argument tests:
double m0(void) { return opc0(); }
double m1(int i) { return opc1(i); }
Expand Down

0 comments on commit c005354

Please sign in to comment.