7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for ActionDirector"
12 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE( ActionDirectorSuite )
32 typedef boost::shared_ptr<SetIntegerAction>
Ptr;
33 typedef boost::shared_ptr<SetIntegerAction const>
ConstPtr;
35 static std::string
type_name () {
return "SetIntegerAction"; }
53 BOOST_CHECK_EQUAL(test_action->value, 1);
63 BOOST_CHECK_EQUAL(test_action2->value, 1);
65 BOOST_CHECK_EQUAL(test_action2->value, 3);
74 boost::shared_ptr<SetIntegerAction> test_action3_shared = allocate_component<SetIntegerAction>(
"testaction3");
79 *director << test_action3_shared << test_action3_handle << test_action3_ref;
81 BOOST_CHECK_EQUAL(test_action3_handle->value, 3);
83 BOOST_CHECK_EQUAL(test_action3_handle->value, 8);
88 BOOST_AUTO_TEST_SUITE_END()
std::string name(ComponentWrapper &self)
Safe pointer to an object. This is the supported method for referring to components.
boost::shared_ptr< SetIntegerAction const > ConstPtr
BOOST_AUTO_TEST_CASE(ActionDirectorBasic)
static std::string type_name()
SetIntegerAction(const std::string &name)
Uniform Resource Identifier (see http://en.wikipedia.org/wiki/Uniform_Resource_Identifier) ...
virtual void execute()
execute the action
Handle< Component > get_child(const std::string &name)
Action that sets an integer, for testing purposes.
Top-level namespace for coolfluid.
Component that executes an action. Implementation of the IAction interface as a component, exposing the execute function as a signal.
common::Component & root() const
Gives the default root component.
unsigned int Uint
typedef for unsigned int
coolfluid3 header, included almost everywhere
boost::shared_ptr< SetIntegerAction > Ptr
virtual void execute()
Execute all active child actions.
Base class for defining CF components.
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Most basic kernel library.