#include "boost/test/unit_test.hpp"
#include "fhiclcpp/types/Atom.h"
#include "fhiclcpp/types/Sequence.h"
#include "fhiclcpp/types/Tuple.h"
#include <string>
#include <vector>
Go to the source code of this file.
#define BOOST_TEST_MODULE (return value defaults) |
BOOST_AUTO_TEST_CASE |
( |
one_atom_t |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
one_sequence_t |
| ) |
|
Definition at line 34 of file return_value_defaults_t.cc.
38 BOOST_TEST(
test() == ref, boost::test_tools::per_element{});
40 for (
auto const& elem : ref)
41 BOOST_TEST(elem ==
test(i++));
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
one_sequence_2_t |
| ) |
|
Definition at line 45 of file return_value_defaults_t.cc.
49 BOOST_TEST(
test() == ref, boost::test_tools::per_element{});
52 for (
auto const& elem : ref)
53 BOOST_TEST(elem ==
test(i++));
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
one_tuple_t |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
seq_in_tuple_t |
| ) |
|
Definition at line 66 of file return_value_defaults_t.cc.
70 BOOST_TEST(
test.get<0>() == ref, boost::test_tools::per_element{});
71 BOOST_TEST(
test.get<1>() == 4.6);
72 BOOST_TEST(
test.get<2>() ==
true);
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE |
( |
bounded_seq_in_tuple_t |
| ) |
|
Definition at line 76 of file return_value_defaults_t.cc.
80 BOOST_TEST(
test.get<0>() == ref, boost::test_tools::per_element{});
81 BOOST_TEST(
test.get<1>() == 0.2);
82 BOOST_TEST(
test.get<2>() ==
false);
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE |
( |
tuple_in_tuple_t |
| ) |
|
Definition at line 86 of file return_value_defaults_t.cc.
89 {{4, 3.7f}, 8.1,
true}};
90 auto const tuple0 =
test.get<0>();
91 BOOST_TEST(std::get<0>(tuple0) == 4);
92 BOOST_TEST(std::get<1>(tuple0) == 3.7
f);
93 BOOST_TEST(
test.get<1>() == 8.1);
94 BOOST_TEST(
test.get<2>() ==
true);
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE |
( |
tuple_in_seq_t |
| ) |
|
Definition at line 98 of file return_value_defaults_t.cc.
100 std::vector<std::tuple<int, float>> ref_vec{std::make_tuple(2, 5.4
f),
101 std::make_tuple(4, 104.5
f),
102 std::make_tuple(8, 15.3
f)};
104 {{2, 5.4f}, {4, 104.5f}, {8, 15.3f}}};
106 for (
auto const& elem :
test()) {
107 BOOST_TEST(std::get<0>(elem) == std::get<0>(ref_vec.at(i)));
108 BOOST_TEST(std::get<1>(elem) == std::get<1>(ref_vec.at(i++)));
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
tuple_in_seq_2_t |
| ) |
|
Definition at line 113 of file return_value_defaults_t.cc.
115 std::array<std::tuple<int, float>, 2> ref_vec{
116 {std::make_tuple(1, 2.3
f), std::make_tuple(9, 3.2
f)}};
120 for (
auto const& elem :
test()) {
121 BOOST_TEST(std::get<0>(elem) == std::get<0>(ref_vec.at(i)));
122 BOOST_TEST(std::get<1>(elem) == std::get<1>(ref_vec.at(i++)));
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
seq_in_seq_t |
| ) |
|
Definition at line 127 of file return_value_defaults_t.cc.
129 auto ref_vec = std::vector<std::vector<int>>{{1, 5, 7}, {2}};
132 for (
auto const&
val :
test()) {
133 auto ref = ref_vec.at(i++);
134 BOOST_TEST(
val == ref);
138 for (
auto const& ref : ref_vec) {
140 BOOST_TEST(
val == ref);
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
seq_2_in_seq_t |
| ) |
|
Definition at line 145 of file return_value_defaults_t.cc.
147 auto ref_vec = std::vector<std::array<int, 2>>{{{1, 2}}};
150 for (
auto const&
val :
test()) {
151 auto ref = ref_vec.at(i++);
152 BOOST_TEST(
val == ref);
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
seq_in_seq_2_t |
| ) |
|
Definition at line 157 of file return_value_defaults_t.cc.
159 std::array<std::vector<int>, 2> ref_vec{
160 {std::vector<int>{4}, std::vector<int>{{1, 4, 9, 1}}}};
164 for (
auto const&
val :
test()) {
165 auto ref = ref_vec.at(i++);
166 BOOST_TEST(
val == ref);
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE |
( |
seq_2_in_seq_2_t |
| ) |
|
Definition at line 171 of file return_value_defaults_t.cc.
173 std::array<std::array<int, 2>, 2> ref_vec{
174 {std::array<int, 2>{{6, 7}}, std::array<int, 2>{{2, 1}}}};
178 for (
auto const&
val :
test()) {
179 auto ref = ref_vec.at(i++);
180 BOOST_TEST(
val == ref);
ChannelGroupService::Name Name
yes & test(std::ostream &)