Macros | Functions
conditional_t.cc File Reference
#include "CondConfig.h"
#include "boost/test/unit_test.hpp"
#include "fhiclcpp/ParameterSet.h"
#include "fhiclcpp/types/Table.h"
#include <iostream>
#include <string>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (keymap test)
 

Functions

 BOOST_AUTO_TEST_CASE (cond_01_t)
 
 BOOST_AUTO_TEST_CASE (cond_02_t)
 
 BOOST_AUTO_TEST_CASE (cond_03_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (keymap test)

Definition at line 1 of file conditional_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( cond_01_t  )

Definition at line 25 of file conditional_t.cc.

26 {
27  std::string const file{"cond_01_t.fcl"};
28  Table<CondConfig> table{Name("pset")};
29  try {
30  table.validate(create_PSet(file).get<fhicl::ParameterSet>("pset"));
31  }
32  catch (fhicl::detail::validationException const& e) {
33  std::cout << e.what() << std::endl;
34  }
35 }
std::string string
Definition: nybbler.cc:12
ChannelGroupService::Name Name
const double e
char const * what() const noexcept override
QTextStream & endl(QTextStream &s)
BOOST_AUTO_TEST_CASE ( cond_02_t  )

Definition at line 37 of file conditional_t.cc.

38 {
39  std::string const file{"cond_02_t.fcl"};
40  Table<CondConfig> table{Name("pset")};
41  table.validate(create_PSet(file).get<fhicl::ParameterSet>("pset"));
42  BOOST_TEST(table().flag() == false);
43  BOOST_TEST(table().num2() == 4);
44  BOOST_TEST(table().shape() == "sphere");
45  BOOST_TEST(table().sphereParams().radius() == 7);
46 }
std::string string
Definition: nybbler.cc:12
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE ( cond_03_t  )

Definition at line 48 of file conditional_t.cc.

49 {
50  std::string const file{"cond_03_t.fcl"};
51  Table<CondConfig> table{Name("pset")};
52  table.validate(create_PSet(file).get<fhicl::ParameterSet>("pset"));
53  BOOST_TEST(table().flag() == true);
54  int number{16};
55  BOOST_TEST(table().num1(number) == false);
56  BOOST_TEST(table().shape() == "box");
57  auto ref = {4, 9, 2};
58  auto hls = table().boxParams().halfLengths();
59  BOOST_TEST(hls() == ref, boost::test_tools::per_element{});
60  BOOST_TEST(table().boxParams().material() == "Wood");
62  BOOST_TEST(table().boxParams().boxName(name) == true);
63  BOOST_TEST(name == "Stan");
64 }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
ChannelGroupService::Name Name