#include "boost/test/unit_test.hpp"
#include "KeyMap.h"
#include "fhiclcpp/types/Atom.h"
#include "fhiclcpp/types/Sequence.h"
#include "fhiclcpp/types/Tuple.h"
#include <string>
Go to the source code of this file.
#define BOOST_TEST_MODULE (keymap test) |
BOOST_AUTO_TEST_CASE |
( |
one_atom_t |
| ) |
|
Definition at line 26 of file keymap_t.cc.
28 auto map = KeyMap::get<Atom<int>>(
"atom");
30 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
one_sequence_t |
| ) |
|
Definition at line 34 of file keymap_t.cc.
36 auto map = KeyMap::get<Sequence<int>>(
"sequence");
37 auto ref = {
"sequence",
"sequence[0]"};
38 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
one_sequence_2_t |
| ) |
|
Definition at line 42 of file keymap_t.cc.
44 auto map = KeyMap::get<Sequence<int, 2>>(
"sequence");
45 auto ref = {
"sequence",
"sequence[0]",
"sequence[1]"};
46 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
one_tuple_t |
| ) |
|
Definition at line 50 of file keymap_t.cc.
52 auto map = KeyMap::get<Tuple<int, double, bool>>(
"tuple");
53 auto ref = {
"tuple",
"tuple[0]",
"tuple[1]",
"tuple[2]"};
54 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
seq_in_tuple_t |
| ) |
|
Definition at line 58 of file keymap_t.cc.
60 auto map = KeyMap::get<Tuple<Sequence<int>, double,
bool>>(
"tuple");
61 auto ref = {
"tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[1]",
"tuple[2]"};
62 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
bounded_seq_in_tuple_t |
| ) |
|
Definition at line 66 of file keymap_t.cc.
68 auto map = KeyMap::get<Tuple<Sequence<int, 2>, double,
bool>>(
"tuple");
70 "tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[0][1]",
"tuple[1]",
"tuple[2]"};
71 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
tuple_in_tuple_t |
| ) |
|
Definition at line 75 of file keymap_t.cc.
77 auto map = KeyMap::get<Tuple<Tuple<int, float>, double,
bool>>(
"tuple");
79 "tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[0][1]",
"tuple[1]",
"tuple[2]"};
80 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
tuple_in_seq_t |
| ) |
|
Definition at line 84 of file keymap_t.cc.
86 auto map = KeyMap::get<Sequence<Tuple<int, float>>>(
"seqtuple");
87 auto ref = {
"seqtuple",
"seqtuple[0]",
"seqtuple[0][0]",
"seqtuple[0][1]"};
88 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
tuple_in_seq_2_t |
| ) |
|
Definition at line 92 of file keymap_t.cc.
94 auto map = KeyMap::get<Sequence<Tuple<int, float>, 2>>(
"seqtuple");
95 auto ref = {
"seqtuple",
102 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
seq_in_seq_t |
| ) |
|
Definition at line 106 of file keymap_t.cc.
108 auto map = KeyMap::get<Sequence<Sequence<int>>>(
"seqseq");
109 auto ref = {
"seqseq",
"seqseq[0]",
"seqseq[0][0]"};
110 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
seq_2_in_seq_t |
| ) |
|
Definition at line 114 of file keymap_t.cc.
116 auto map = KeyMap::get<Sequence<Sequence<int, 2>>>(
"seqseq");
117 auto ref = {
"seqseq",
"seqseq[0]",
"seqseq[0][0]",
"seqseq[0][1]"};
118 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
seq_in_seq_2_t |
| ) |
|
Definition at line 122 of file keymap_t.cc.
124 auto map = KeyMap::get<Sequence<Sequence<int>, 2>>(
"seqseq");
126 "seqseq",
"seqseq[0]",
"seqseq[0][0]",
"seqseq[1]",
"seqseq[1][0]"};
127 BOOST_TEST(map == ref, boost::test_tools::per_element{});
BOOST_AUTO_TEST_CASE |
( |
seq_2_in_seq_2_t |
| ) |
|
Definition at line 131 of file keymap_t.cc.
133 auto map = KeyMap::get<Sequence<Sequence<int, 2>, 2>>(
"seqseq");
134 auto ref = {
"seqseq",
141 BOOST_TEST(map == ref, boost::test_tools::per_element{});