7#ifndef TEST_TO_ELEMENT_H
8#define TEST_TO_ELEMENT_H
12#include <gtest/gtest.h>
16#ifndef CONFIG_H_WAS_INCLUDED
17#error config.h must be included before test_to_element.h
55template <
typename Cfg>
59 static_assert(std::is_base_of<CfgToElement, Cfg>::value,
60 "CfgToElement is not a base of the template parameter");
64 ASSERT_NO_THROW(unparsed = cfg.toElement());
68 ADD_FAILURE() <<
"Expected:\n" << wanted <<
"\n"
82 static_assert(std::is_base_of<isc::data::CfgToElement, Cfg>::value,
83 "CfgToElement is not a base of the template parameter");
85 ASSERT_NO_THROW(unparsed = cfg.toElement());
89 ADD_FAILURE() <<
"Expected:\n" << wanted <<
"\n"
static ElementPtr fromJSON(const std::string &in, bool preproc=false)
These functions will parse the given string (JSON) representation of a compound element.
boost::shared_ptr< const Element > ConstElementPtr
bool isEquivalent(ConstElementPtr a, ConstElementPtr b)
Compares the data with other using unordered lists.
void prettyPrint(ConstElementPtr element, std::ostream &out, unsigned indent, unsigned step)
Pretty prints the data into stream.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
void expectEqWithDiff(ConstElementPtr const &a, ConstElementPtr const &b)
Expect two element pointers to be equal.
void runToElementTest(const std::string &expected, const Cfg &cfg)
Run a test using toElement() method with a string.
void assertEqWithDiff(ConstElementPtr const &a, ConstElementPtr const &b)
std::string generateDiff(std::string, std::string)
Return the difference between two strings.
Defines the logger used by the top-level component of kea-lfc.