COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-create-component-datatype.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for DataComponentWrapper.hpp"
9 
10 #include <set>
11 #include <boost/test/unit_test.hpp>
12 
13 #include "common/CF.hpp"
15 #include "common/Log.hpp"
16 #include "common/Foreach.hpp"
17 
19 
20 using namespace cf3;
21 using namespace cf3::common;
22 
24 {
27  {
28  }
29 
32  {
33  }
34 
35  create_component_data_type( std::set<int> , Common_API, Component_std_set_int, "Component_std_set<integer>");
36 };
37 
39 
40 BOOST_FIXTURE_TEST_SUITE( DataComponentWrapperTests, DataComponentWrapperFixture )
41 
42 
44 BOOST_AUTO_TEST_CASE ( test_DataComponentWrapper )
45 {
46  boost::shared_ptr<Component_std_set_int> comp_set = allocate_component<Component_std_set_int>("set");
47 
48  std::set<int>& wrapped_set = comp_set->data();
49 
50  BOOST_CHECK_EQUAL(comp_set->data().size() , 0u);
51 
52  wrapped_set.insert(5);
53 
54  BOOST_CHECK_EQUAL(comp_set->data().size() , 1u);
55 }
56 
58 
59 
60 BOOST_AUTO_TEST_SUITE_END()
61 
62 
#define create_component_data_type(data_type, API, CName, Cname_type_name)
macro to create data wrapping component type This macro creates a component class that wraps any give...
BOOST_AUTO_TEST_CASE(test_DataComponentWrapper)
Top-level namespace for coolfluid.
Definition: Action.cpp:18
DataComponentWrapperFixture()
common setup for each test case
#define Common_API
Definition: CommonAPI.hpp:29
coolfluid3 header, included almost everywhere
~DataComponentWrapperFixture()
common tear-down for each test case
Most basic kernel library.
Definition: Action.cpp:19
Send comments to:
COOLFluiD Web Admin