Macros | Functions
get_via_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "cetlib/container_algorithms.h"
#include "fhiclcpp/ParameterSet.h"
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (get via converter test)
 

Functions

 BOOST_AUTO_TEST_CASE (via_test)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (get via converter test)

Definition at line 1 of file get_via_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( via_test  )

Definition at line 29 of file get_via_t.cc.

30 {
31  auto const config = "number: 5 "
32  "names: ['Esther', 'Julian', 'Bobby']"s;
33  auto const pset = ParameterSet::make(config);
34  BOOST_TEST(pset.get<int>("number") == 5);
35 
36  auto check_value = [](int const& i) { return i == 5; };
37  auto const supplied_5 = pset.get<bool, int>("number", check_value);
38  BOOST_TEST(supplied_5);
39 
40  auto const sorted_names = pset.get("names", to_sorted_names);
41  std::vector const ref{"Bobby"s, "Esther"s, "Julian"s};
42  BOOST_TEST(sorted_names.names == ref);
43 }
struct vector vector
static Config * config
Definition: config.cpp:1054
unique_ptr< InputSource > make(ParameterSet const &conf, InputSourceDescription &desc)
int bool
Definition: qglobal.h:345
static QCString * s
Definition: config.cpp:1042