#include "boost/test/unit_test.hpp"
#include "fhiclcpp/ParameterSet.h"
#include "fhiclcpp/intermediate_table.h"
#include <string>
#include <vector>
Go to the source code of this file.
#define BOOST_TEST_MODULE (intermediate_table_t) |
BOOST_AUTO_TEST_CASE |
( |
main |
| ) |
|
Definition at line 14 of file intermediate_table_t.cc.
19 table.
put(
"string1",
"string");
21 table.
put(
"complex", std::complex<double>(-3, -0.5));
22 table.
put(
"sequence", std::vector<int>{5, 10, 15, 20, 25});
23 table.
put(
"double", 28.5);
24 table.
put(
"sequence[6]", 35);
25 table.
put(
"table.val1", 92);
26 table.
put(
"table.t1.val",
"oops");
27 BOOST_CHECK_NO_THROW(table.
erase(
"table.t1.waldo"));
28 BOOST_CHECK_NO_THROW(table.
erase(
"table.t1.val"));
29 BOOST_TEST(!table.
exists(
"table.t1.val"));
33 BOOST_TEST(table.
get<std::complex<double>>(
"complex") ==
34 std::complex<double>(-3, -0.5));
35 BOOST_TEST(table.
get<
sequence_t const&>(
"sequence").size() == 7u);
36 BOOST_TEST(table.
get<
int>(
"sequence[3]") == 20);
fhicl::extended_value::table_t table_t
fhicl::extended_value::sequence_t sequence_t
cet::coded_exception< error, detail::translate > exception
BOOST_AUTO_TEST_CASE |
( |
prolog_erase_nested |
| ) |
|
Definition at line 42 of file intermediate_table_t.cc.
44 char const* cfg = R
"(BEGIN_PROLOG 45 w: { x: { y: { z: { a: 2 b: 3 } } } } 47 q: { @table::w.x.y })"; 49 BOOST_TEST(pset.has_key(
"q.z"));
50 BOOST_TEST(!pset.has_key(
"w"));
BOOST_AUTO_TEST_CASE |
( |
prolog_erase_dotted |
| ) |
|
Definition at line 53 of file intermediate_table_t.cc.
55 char const* cfg = R
"(BEGIN_PROLOG 56 w.x.y: { z: { a: 2 b: 3 } } 58 q: { @table::w.x.y })"; 60 BOOST_TEST(pset.has_key(
"q.z"));
61 BOOST_TEST(!pset.has_key(
"w"));
BOOST_AUTO_TEST_CASE |
( |
prolog_nested_partial_dup_nested |
| ) |
|
Definition at line 64 of file intermediate_table_t.cc.
66 char const* cfg = R
"(BEGIN_PROLOG 71 BOOST_TEST(pset.has_key(
"w.b"));
72 BOOST_TEST(!pset.has_key(
"w.x"));
BOOST_AUTO_TEST_CASE |
( |
prolog_nested_partial_dup_dotted |
| ) |
|
Definition at line 75 of file intermediate_table_t.cc.
77 char const* cfg = R
"(BEGIN_PROLOG 82 BOOST_TEST(pset.has_key(
"w.b"));
83 BOOST_TEST(!pset.has_key(
"w.x"));
BOOST_AUTO_TEST_CASE |
( |
prolog_dotted_partial_dup_nested |
| ) |
|
Definition at line 86 of file intermediate_table_t.cc.
88 char const* cfg = R
"(BEGIN_PROLOG 93 BOOST_TEST(pset.has_key(
"w.b"));
94 BOOST_TEST(!pset.has_key(
"w.x"));
BOOST_AUTO_TEST_CASE |
( |
prolog_dotted_partial_dup_dotted |
| ) |
|
Definition at line 97 of file intermediate_table_t.cc.
99 char const* cfg = R
"(BEGIN_PROLOG 104 BOOST_TEST(pset.has_key(
"w.b"));
105 BOOST_TEST(!pset.has_key(
"w.x"));
BOOST_AUTO_TEST_CASE |
( |
prolog_nested_dup_nested |
| ) |
|
Definition at line 108 of file intermediate_table_t.cc.
110 char const* cfg = R
"(BEGIN_PROLOG 113 w: { x: { c: 6 } })"; 115 BOOST_TEST(pset.has_key(
"w.x.c"));
116 BOOST_TEST(!pset.has_key(
"w.x.y"));
BOOST_AUTO_TEST_CASE |
( |
prolog_nested_dup_dotted |
| ) |
|
Definition at line 119 of file intermediate_table_t.cc.
121 char const* cfg = R
"(BEGIN_PROLOG 126 BOOST_TEST(pset.has_key(
"w.x.c"));
127 BOOST_TEST(!pset.has_key(
"w.x.y"));
BOOST_AUTO_TEST_CASE |
( |
prolog_dotted_dup_nested |
| ) |
|
Definition at line 130 of file intermediate_table_t.cc.
132 char const* cfg = R
"(BEGIN_PROLOG 135 w: { x: { c: 6 } })"; 137 BOOST_TEST(pset.has_key(
"w.x.c"));
138 BOOST_TEST(!pset.has_key(
"w.x.y"));
BOOST_AUTO_TEST_CASE |
( |
prolog_dotted_dup_dotted |
| ) |
|
Definition at line 141 of file intermediate_table_t.cc.
143 char const* cfg = R
"(BEGIN_PROLOG 148 BOOST_TEST(pset.has_key(
"w.x.c"));
149 BOOST_TEST(!pset.has_key(
"w.x.y"));