Kea: test_to_element.cc Source File

| Kea 2.2.0

test_to_element.cc
Go to the documentation of this file.
1// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8
9#include <testutils/test_to_element.h>
10#include <boost/algorithm/string.hpp>
11#include <gtest/gtest.h>
12#include <string>
13#include <vector>
14
15namespace isc {
16namespace test {
17
18#ifdef HAVE_CREATE_UNIFIED_DIFF
19std::string generateDiff(std::string left, std::string right) {
20 std::vector<std::string> left_lines;
21 boost::split(left_lines, left, boost::is_any_of("\n"));
22 std::vector<std::string> right_lines;
23 boost::split(right_lines, right, boost::is_any_of("\n"));
24 using namespace testing::internal;
25 return (edit_distance::CreateUnifiedDiff(left_lines, right_lines));
26}
27#else
28std::string generateDiff(std::string, std::string) {
29 return ("");
30}
31#endif
32
33}; // end of isc::test namespace
34}; // end of isc namespace
isc::test::generateDiff
std::string generateDiff(std::string, std::string)
Return the difference between two strings.
Definition: test_to_element.cc:28
isc
Defines the logger used by the top-level component of kea-lfc.
Definition: agent_parser.cc:143
test_to_element.h