Classes | Macros | Functions
get_sequence_elements_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "fhiclcpp/ParameterSet.h"
#include <vector>

Go to the source code of this file.

Classes

struct  SampleConfigFixture
 

Macros

#define BOOST_TEST_MODULE   (get sequence elements test)
 

Functions

 BOOST_AUTO_TEST_CASE (element_lookup)
 
 BOOST_AUTO_TEST_CASE (element_container_lookup)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (get sequence elements test)

Definition at line 1 of file get_sequence_elements_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( element_lookup  )

Definition at line 25 of file get_sequence_elements_t.cc.

26 {
27  BOOST_TEST(pset.get<int>("g[0]") == 1);
28  BOOST_TEST(pset.get<int>("h[0].h1") == 12);
29  BOOST_TEST(pset.get<int>("m[0]") == -1);
30  BOOST_TEST(pset.get<int>("vv[0][1]") == 2);
31 
32  BOOST_TEST(pset.get<std::string>("h[1].h2") == "h2");
33 }
std::string string
Definition: nybbler.cc:12
BOOST_AUTO_TEST_CASE ( element_container_lookup  )

Definition at line 35 of file get_sequence_elements_t.cc.

36 {
37  auto const vec0 = pset.get<std::vector<int>>("vv[0]");
38  std::vector const ref0{1, 2, 3};
39  BOOST_TEST(vec0 == ref0);
40 
41  auto vec1 = pset.get<std::vector<int>>("vv[1]");
42  std::vector const ref1{2, 3, 4};
43  BOOST_TEST(vec1 == ref1);
44 }
struct vector vector