Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
test
types
searchAllowedConfiguration_t.cc
Go to the documentation of this file.
1
#define BOOST_TEST_MODULE (search allowed configuration test)
2
3
#include "boost/test/unit_test.hpp"
4
5
#include "
fhiclcpp/types/Atom.h
"
6
#include "
fhiclcpp/types/Sequence.h
"
7
#include "
fhiclcpp/types/Table.h
"
8
#include "
fhiclcpp/types/Tuple.h
"
9
#include "
fhiclcpp/types/detail/SearchAllowedConfiguration.h
"
10
11
#include <string>
12
13
using namespace
fhicl
;
14
using namespace
fhicl::detail
;
15
using namespace
std
;
16
auto
supports_key
=
SearchAllowedConfiguration::supports_key
;
17
18
namespace
{
19
20
struct
S
{
21
Atom<int>
test
{
Name
{
"atom"
}};
22
Sequence<int, 2>
seq{
Name
{
"sequence"
}};
23
Tuple<int, double, bool>
tuple{
Name
{
"tuple"
}};
24
struct
U {
25
Atom<int>
test
{
Name
{
"nested_atom"
}};
26
};
27
Tuple<Sequence<int, 2>
,
bool
> tuple2{
Name
{
"tuple2"
}};
28
Table<U>
table2{
Name
{
"table2"
}};
29
};
30
}
31
32
BOOST_AUTO_TEST_SUITE(searchAllowedConfiguration_test)
33
34
BOOST_AUTO_TEST_CASE
(
table_t
)
35
{
36
Table<S>
t
{
Name
{
"table"
}};
37
BOOST_TEST(
supports_key
(
t
,
"atom"
));
38
BOOST_TEST(!
supports_key
(
t
,
"table.atom"
));
39
BOOST_TEST(!
supports_key
(
t
,
"table.sequence"
));
40
BOOST_TEST(
supports_key
(
t
,
"sequence"
));
41
BOOST_TEST(
supports_key
(
t
,
"sequence[0]"
));
42
BOOST_TEST(!
supports_key
(
t
,
"[0]"
));
43
BOOST_TEST(
supports_key
(
t
,
"table2"
));
44
BOOST_TEST(
supports_key
(
t
,
"tuple2[0][1]"
));
45
BOOST_TEST(
supports_key
(
t
,
"tuple2[1]"
));
46
}
47
48
BOOST_AUTO_TEST_CASE
(seqInSeq_t)
49
{
50
Sequence<Sequence<int, 2>
>
s
{
Name
{
"nestedSequence"
}};
51
BOOST_TEST(
supports_key
(
s
,
"[0]"
));
52
BOOST_TEST(
supports_key
(
s
,
"[0][0]"
));
53
BOOST_TEST(
supports_key
(
s
,
"[0][1]"
));
54
}
55
56
BOOST_AUTO_TEST_SUITE_END()
Sequence.h
fhicl::Table
Definition:
type_traits.h:30
test
Definition:
PandoraAnalysis_module.cc:49
ValidateOpDetReco.S
S
Definition:
ValidateOpDetReco.py:310
std
STL namespace.
supports_key
auto supports_key
Definition:
searchAllowedConfiguration_t.cc:16
SearchAllowedConfiguration.h
fhicl
Definition:
InputSourceFactory.h:7
reco_momentum_tuples.t
t
Definition:
reco_momentum_tuples.py:25
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(table_t)
Definition:
searchAllowedConfiguration_t.cc:34
fhicl::Atom< int >
Tuple.h
Table.h
Atom.h
fhicl::detail
Definition:
coding.h:43
fhicl::Sequence
Definition:
type_traits.h:43
fhicl::Tuple
Definition:
type_traits.h:38
fhicl::detail::SearchAllowedConfiguration::supports_key
static bool supports_key(ParameterBase const &pb, std::string const &searched_for_key)
Definition:
SearchAllowedConfiguration.cc:8
s
static QCString * s
Definition:
config.cpp:1042
fhicl::Name
Definition:
Name.h:10
shims::map
Definition:
stdmap_shims.h:21
Generated by
1.8.11