Macros | Functions
return_table_values_from_fcl_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "fhiclcpp/types/Atom.h"
#include "fhiclcpp/types/Sequence.h"
#include "fhiclcpp/types/Table.h"
#include "fhiclcpp/types/TableFragment.h"
#include "fhiclcpp/types/Tuple.h"
#include "FixtureBase.h"
#include <iostream>
#include <limits>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (return table values from fcl)
 

Functions

 BOOST_AUTO_TEST_CASE (table_t)
 
 BOOST_AUTO_TEST_CASE (table_in_seq_t)
 
 BOOST_AUTO_TEST_CASE (table_in_seq_2_t)
 
 BOOST_AUTO_TEST_CASE (table_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (vec_table_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (arr_table_in_tuple_t)
 
 BOOST_AUTO_TEST_CASE (tup_table_in_vec_t)
 
 BOOST_AUTO_TEST_CASE (tup_table_in_arr_t)
 
 BOOST_AUTO_TEST_CASE (tableFragment_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (return table values from fcl)

Definition at line 10 of file return_table_values_from_fcl_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( table_t  )

Definition at line 113 of file return_table_values_from_fcl_t.cc.

114 {
115  RefS ref(4, 3, 6, 8, "something", false);
116  BOOST_TEST(config().table() == ref);
117 }
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( table_in_seq_t  )

Definition at line 120 of file return_table_values_from_fcl_t.cc.

121 {
122  auto ref = {RefS{0, 10, 100, 0, "something0", true}};
123  auto it = ref.begin();
124 
125  for (auto const& table : config().vecOfTable())
126  BOOST_TEST(table == *it++);
127 }
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( table_in_seq_2_t  )

Definition at line 130 of file return_table_values_from_fcl_t.cc.

131 {
132  auto ref = {RefS{0, 10, 100, 0, "array0", true},
133  RefS{1, 11, 101, 1, "array1", true}};
134 
135  auto it = ref.begin();
136 
137  for (auto const& table : config().arrOfTable())
138  BOOST_TEST(table == *it++);
139 }
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( table_in_tuple_t  )

Definition at line 142 of file return_table_values_from_fcl_t.cc.

143 {
144  RefS ref{3, 13, 103, 3, "tup0", true};
145  BOOST_TEST(config().tupWithTable.get<0>() == ref);
146  BOOST_TEST(config().tupWithTable.get<1>() == 981);
147  BOOST_TEST(config().tupWithTable.get<2>() == 581.1, tolerance);
148 }
auto const tolerance
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( vec_table_in_tuple_t  )

Definition at line 151 of file return_table_values_from_fcl_t.cc.

152 {
153  auto ref = {RefS{4, 14, 104, 4, "tup0", true}};
154  auto it = ref.begin();
155  for (auto const& table : config().tupWithVecTable.get<0>())
156  BOOST_TEST(table == *it++);
157  BOOST_TEST(config().tupWithVecTable.get<1>() == 345);
158  BOOST_TEST(config().tupWithVecTable.get<2>() == 234.14, tolerance);
159 }
auto const tolerance
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( arr_table_in_tuple_t  )

Definition at line 162 of file return_table_values_from_fcl_t.cc.

163 {
164  auto ref = {RefS{5, 15, 105, 5, "tup0", true},
165  RefS{6, 16, 106, 6, "tup1", true}};
166  auto it = ref.begin();
167 
168  for (auto const& table : config().tupWithArrTable.get<0>())
169  BOOST_TEST(table == *it++);
170  BOOST_TEST(config().tupWithArrTable.get<1>() == 789);
171  BOOST_TEST(config().tupWithArrTable.get<2>() == 17.06, tolerance);
172 }
auto const tolerance
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( tup_table_in_vec_t  )

Definition at line 175 of file return_table_values_from_fcl_t.cc.

176 {
177  auto ref = RefS{7, 17, 107, 7, "tup0", true};
178 
179  for (auto const& tup : config().vecWithTupTable()) {
180  BOOST_TEST(std::get<0>(tup) == ref);
181  BOOST_TEST(std::get<1>(tup) == 4);
182  BOOST_TEST(std::get<2>(tup) == 1.0004, tolerance);
183  }
184 }
auto const tolerance
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( tup_table_in_arr_t  )

Definition at line 187 of file return_table_values_from_fcl_t.cc.

188 {
189  auto ref_ts = {RefS{8, 18, 108, 8, "tup0", true},
190  RefS{9, 19, 109, 9, "tup1", true}};
191  auto ref_is = {4, 40};
192  auto ref_ds = {0.89881, 1.47412};
193 
194  auto it_ts = ref_ts.begin();
195  auto it_is = ref_is.begin();
196  auto it_ds = ref_ds.begin();
197 
198  for (auto const& tup : config().arrWithTupTable()) {
199  BOOST_TEST(std::get<0>(tup) == *it_ts++);
200  BOOST_TEST(std::get<1>(tup) == *it_is++);
201  BOOST_TEST(std::get<2>(tup) == *it_ds++, tolerance);
202  }
203 }
auto const tolerance
static Config * config
Definition: config.cpp:1054
BOOST_AUTO_TEST_CASE ( tableFragment_t  )

Definition at line 206 of file return_table_values_from_fcl_t.cc.

207 {
208  auto ref = RefS{10, 20, 200, 10, "tup", false};
209  BOOST_TEST(config().tFragment() == ref);
210 }
static Config * config
Definition: config.cpp:1054