preCICE
v3.1.2
Loading...
Searching...
No Matches
src
mesh
tests
DataConfigurationTest.cpp
Go to the documentation of this file.
1
#include <
memory
>
2
#include <
string
>
3
#include <
vector
>
4
#include "
logging/Logger.hpp
"
5
#include "
mesh/config/DataConfiguration.hpp
"
6
#include "
testing/TestContext.hpp
"
7
#include "
testing/Testing.hpp
"
8
#include "
xml/XMLTag.hpp
"
9
10
using namespace
precice
;
11
12
BOOST_AUTO_TEST_SUITE
(MeshTests)
13
14
BOOST_AUTO_TEST_CASE
(DataConfig)
15
{
16
PRECICE_TEST
(1_rank);
17
std::string
filename(
testing::getPathToSources
() +
"/mesh/tests/data-config.xml"
);
18
using
xml::XMLTag
;
19
XMLTag tag =
xml::getRootTag
();
20
mesh::DataConfiguration
dataConfig(tag);
21
xml::configure
(tag,
xml::ConfigurationContext
{}, filename);
22
BOOST_TEST(dataConfig.
data
().size() == 3);
23
BOOST_TEST(dataConfig.
data
().at(0).name ==
"vector-data"
);
24
BOOST_TEST(dataConfig.
data
().at(1).name ==
"floating-data"
);
25
BOOST_TEST(dataConfig.
data
().at(2).name ==
"second-vector-data"
);
26
}
27
28
BOOST_AUTO_TEST_SUITE_END
()
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(DataConfig)
Definition
DataConfigurationTest.cpp:14
DataConfiguration.hpp
Logger.hpp
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
TestContext.hpp
Testing.hpp
PRECICE_TEST
#define PRECICE_TEST(...)
Definition
Testing.hpp:27
XMLTag.hpp
std::string
precice::mesh::DataConfiguration
Performs and provides configuration for Data objects from XML files.
Definition
DataConfiguration.hpp:15
precice::mesh::DataConfiguration::data
const std::vector< ConfiguredData > & data() const
Definition
DataConfiguration.cpp:36
precice::xml::XMLTag
Represents an XML tag to be configured automatically.
Definition
XMLTag.hpp:31
memory
precice::testing::getPathToSources
std::string getPathToSources()
Returns the base path to the sources.
Definition
Testing.cpp:31
precice::xml::getRootTag
XMLTag getRootTag()
Returns an XMLTag::Listener that does nothing on callbacks.
Definition
XMLTag.cpp:389
precice::xml::configure
void configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Definition
XMLTag.cpp:395
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5
string
precice::xml::ConfigurationContext
Tightly coupled to the parameters of Participant()
Definition
XMLTag.hpp:24
vector