7#ifndef TEST_TO_ELEMENT_H
8#define TEST_TO_ELEMENT_H
12#include <gtest/gtest.h>
18#ifndef CONFIG_H_WAS_INCLUDED
19#error config.h must be included before test_to_element.h
33std::string
generateDiff(std::string left, std::string right);
44 static_assert(std::is_base_of<CfgToElement, Cfg>::value,
45 "CfgToElement is not a base of the template parameter");
48 ASSERT_NO_THROW(json = Element::fromJSON(expected)) << expected;
50 ASSERT_NO_THROW(unparsed = cfg.toElement());
54 ADD_FAILURE() <<
"Expected:\n" << wanted <<
"\n"
56#ifdef HAVE_CREATE_UNIFIED_DIFF
71 static_assert(std::is_base_of<isc::data::CfgToElement, Cfg>::value,
72 "CfgToElement is not a base of the template parameter");
75 ASSERT_NO_THROW(unparsed = cfg.toElement());
79 ADD_FAILURE() <<
"Expected:\n" << wanted <<
"\n"
81#ifdef HAVE_CREATE_UNIFIED_DIFF
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
void runToElementTest(const std::string &expected, const Cfg &cfg)
Run a test using toElement() method with a string.
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.