Macros | Functions
keymap_t.cc File Reference
#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.

Macros

#define BOOST_TEST_MODULE   (keymap test)
 

Functions

 BOOST_AUTO_TEST_CASE (one_atom_t)
 
 BOOST_AUTO_TEST_CASE (one_sequence_t)
 
 BOOST_AUTO_TEST_CASE (one_sequence_2_t)
 
 BOOST_AUTO_TEST_CASE (one_tuple_t)
 
 BOOST_AUTO_TEST_CASE (seq_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (bounded_seq_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (tuple_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (tuple_in_seq_t)
 
 BOOST_AUTO_TEST_CASE (tuple_in_seq_2_t)
 
 BOOST_AUTO_TEST_CASE (seq_in_seq_t)
 
 BOOST_AUTO_TEST_CASE (seq_2_in_seq_t)
 
 BOOST_AUTO_TEST_CASE (seq_in_seq_2_t)
 
 BOOST_AUTO_TEST_CASE (seq_2_in_seq_2_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (keymap test)

Definition at line 8 of file keymap_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( one_atom_t  )

Definition at line 26 of file keymap_t.cc.

27 {
28  auto map = KeyMap::get<Atom<int>>("atom");
29  auto ref = {"atom"};
30  BOOST_TEST(map == ref, boost::test_tools::per_element{});
31 }
BOOST_AUTO_TEST_CASE ( one_sequence_t  )

Definition at line 34 of file keymap_t.cc.

35 {
36  auto map = KeyMap::get<Sequence<int>>("sequence");
37  auto ref = {"sequence", "sequence[0]"};
38  BOOST_TEST(map == ref, boost::test_tools::per_element{});
39 }
BOOST_AUTO_TEST_CASE ( one_sequence_2_t  )

Definition at line 42 of file keymap_t.cc.

43 {
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{});
47 }
BOOST_AUTO_TEST_CASE ( one_tuple_t  )

Definition at line 50 of file keymap_t.cc.

51 {
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{});
55 }
BOOST_AUTO_TEST_CASE ( seq_in_tuple_t  )

Definition at line 58 of file keymap_t.cc.

59 {
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{});
63 }
BOOST_AUTO_TEST_CASE ( bounded_seq_in_tuple_t  )

Definition at line 66 of file keymap_t.cc.

67 {
68  auto map = KeyMap::get<Tuple<Sequence<int, 2>, double, bool>>("tuple");
69  auto ref = {
70  "tuple", "tuple[0]", "tuple[0][0]", "tuple[0][1]", "tuple[1]", "tuple[2]"};
71  BOOST_TEST(map == ref, boost::test_tools::per_element{});
72 }
BOOST_AUTO_TEST_CASE ( tuple_in_tuple_t  )

Definition at line 75 of file keymap_t.cc.

76 {
77  auto map = KeyMap::get<Tuple<Tuple<int, float>, double, bool>>("tuple");
78  auto ref = {
79  "tuple", "tuple[0]", "tuple[0][0]", "tuple[0][1]", "tuple[1]", "tuple[2]"};
80  BOOST_TEST(map == ref, boost::test_tools::per_element{});
81 }
BOOST_AUTO_TEST_CASE ( tuple_in_seq_t  )

Definition at line 84 of file keymap_t.cc.

85 {
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{});
89 }
BOOST_AUTO_TEST_CASE ( tuple_in_seq_2_t  )

Definition at line 92 of file keymap_t.cc.

93 {
94  auto map = KeyMap::get<Sequence<Tuple<int, float>, 2>>("seqtuple");
95  auto ref = {"seqtuple",
96  "seqtuple[0]",
97  "seqtuple[0][0]",
98  "seqtuple[0][1]",
99  "seqtuple[1]",
100  "seqtuple[1][0]",
101  "seqtuple[1][1]"};
102  BOOST_TEST(map == ref, boost::test_tools::per_element{});
103 }
BOOST_AUTO_TEST_CASE ( seq_in_seq_t  )

Definition at line 106 of file keymap_t.cc.

107 {
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{});
111 }
BOOST_AUTO_TEST_CASE ( seq_2_in_seq_t  )

Definition at line 114 of file keymap_t.cc.

115 {
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{});
119 }
BOOST_AUTO_TEST_CASE ( seq_in_seq_2_t  )

Definition at line 122 of file keymap_t.cc.

123 {
124  auto map = KeyMap::get<Sequence<Sequence<int>, 2>>("seqseq");
125  auto ref = {
126  "seqseq", "seqseq[0]", "seqseq[0][0]", "seqseq[1]", "seqseq[1][0]"};
127  BOOST_TEST(map == ref, boost::test_tools::per_element{});
128 }
BOOST_AUTO_TEST_CASE ( seq_2_in_seq_2_t  )

Definition at line 131 of file keymap_t.cc.

132 {
133  auto map = KeyMap::get<Sequence<Sequence<int, 2>, 2>>("seqseq");
134  auto ref = {"seqseq",
135  "seqseq[0]",
136  "seqseq[0][0]",
137  "seqseq[0][1]",
138  "seqseq[1]",
139  "seqseq[1][0]",
140  "seqseq[1][1]"};
141  BOOST_TEST(map == ref, boost::test_tools::per_element{});
142 }