table_t_iterator_t.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (table_t_iterator_t)
2 #include "boost/test/unit_test.hpp"
3 
5 
6 using namespace fhicl;
8 
9 BOOST_TEST_DONT_PRINT_LOG_VALUE(table_t::const_iterator)
10 BOOST_TEST_DONT_PRINT_LOG_VALUE(table_t::iterator)
11 
12 BOOST_AUTO_TEST_SUITE(table_t_iterator_t)
13 
14 BOOST_AUTO_TEST_CASE(iterator_comparisons_1)
15 {
16  BOOST_TEST(::shims::isSnippetMode(SNIPPET_MODE) == SNIPPET_MODE);
17 
18  table_t table;
19  table_t const& ctable = table;
20  BOOST_TEST(table.cbegin() == table.cend());
21  BOOST_TEST(table.cbegin() == table.end());
22  BOOST_TEST(table.begin() == table.end());
23  BOOST_TEST(table.begin() == table.cend());
24  BOOST_TEST(ctable.begin() == ctable.end());
25  BOOST_TEST(table.begin() == table.end());
26  BOOST_TEST(ctable.begin() == table.end());
27  BOOST_TEST(table.begin() == ctable.end());
28  table.emplace("string1", extended_value{false, STRING, "string"});
29  BOOST_TEST(table.cbegin() != table.cend());
30  BOOST_TEST(table.cbegin() != table.end());
31  BOOST_TEST(table.begin() != table.end());
32  BOOST_TEST(table.begin() != table.cend());
33  BOOST_TEST(ctable.begin() != ctable.end());
34  BOOST_TEST(table.begin() != table.end());
35  BOOST_TEST(ctable.begin() != table.end());
36  BOOST_TEST(table.begin() != ctable.end());
37 }
38 BOOST_AUTO_TEST_SUITE_END()
iterator begin()
Definition: stdmap_shims.h:150
bool isSnippetMode(bool m)
Definition: parse_shims.cc:9
std::pair< iterator, bool > emplace(Args &&...args)
Definition: stdmap_shims.h:309
iterator end()
Definition: stdmap_shims.h:171
BOOST_AUTO_TEST_CASE(iterator_comparisons_1)
const_iterator cbegin() const
Definition: stdmap_shims.h:165
shims::map< std::string, extended_value > table_t
const_iterator cend() const
Definition: stdmap_shims.h:187