COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-osystem.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 OSystem layer"
9 
10 #include <boost/test/unit_test.hpp>
11 
12 #include "common/OSystem.hpp"
13 #include "common/OSystemLayer.hpp"
14 
15 using namespace std;
16 using namespace cf3;
17 using namespace cf3::common;
18 
20 
22 {
25 
28 };
29 
31 
32 BOOST_FIXTURE_TEST_SUITE( OSystem_TestSuite, OSystemFixture )
33 
34 
37 {
38 }
39 
40 BOOST_AUTO_TEST_CASE( libloader_ptr )
41 {
42  BOOST_CHECK( OSystem::instance().lib_loader() != nullptr );
43 }
44 
45 BOOST_AUTO_TEST_CASE( execute_command )
46 {
48  // should exit normally
49  BOOST_CHECK_NO_THROW( OSystem::instance().layer()->execute_command("echo"));
50  // the command does *normally* not exist, should throw an exception
52  //BOOST_CHECK_THROW( OSystem::instance().execute_command("cd /aDirThatDoesNotExist"), OSystemError);
53 }
54 
56 {
57  BOOST_CHECK( OSystem::instance().layer() != nullptr );
58 
59  BOOST_CHECK( OSystem::instance().layer()->platform_name() != std::string() );
60 
61  BOOST_CHECK( OSystem::instance().layer()->back_trace() != std::string() );
62 
63  BOOST_CHECK( OSystem::instance().layer()->process_id() > 0 );
64 
65  BOOST_CHECK( OSystem::instance().layer()->memory_usage() > 0 );
66 }
67 
69 
70 BOOST_AUTO_TEST_SUITE_END()
STL namespace.
~OSystemFixture()
common tear-down for each test case
Top-level namespace for coolfluid.
Definition: Action.cpp:18
OSystemFixture()
common setup for each test case
BOOST_AUTO_TEST_CASE(layer_ptr)
Most basic kernel library.
Definition: Action.cpp:19
Send comments to:
COOLFluiD Web Admin