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

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (has_key of dotted names test)
 

Functions

 BOOST_AUTO_TEST_CASE (dotted_names_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (has_key of dotted names test)

Definition at line 1 of file dotted_names.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( dotted_names_t  )

Definition at line 10 of file dotted_names.cc.

11 {
12  std::string text("m1: { val: 3 name: boo} ");
13  auto const ps = fhicl::ParameterSet::make(text);
14 
15  BOOST_TEST(ps.has_key("m1.val"));
16  BOOST_TEST(!ps.has_key("m1.val.three"));
17  BOOST_TEST(ps.get<int>("m1.val") == 3);
18  BOOST_TEST(ps.get<std::string>("m1.name") == "boo");
19  BOOST_TEST(!ps.has_key("m0"));
20  BOOST_TEST(!ps.has_key("m0.nothing.to.see.here"));
21 }
std::string string
Definition: nybbler.cc:12
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
static constexpr double ps
Definition: Units.h:99