Kea  1.9.9-git
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 
10 #include <boost/algorithm/string.hpp>
11 #include <gtest/gtest.h>
12 #include <string>
13 #include <vector>
14 
15 namespace isc {
16 namespace test {
17 
18 #ifdef HAVE_CREATE_UNIFIED_DIFF
19 std::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
28 std::string generateDiff(std::string, std::string) {
29  return ("");
30 }
31 #endif
32 
33 }; // end of isc::test namespace
34 }; // end of isc namespace
std::string generateDiff(std::string, std::string)
Return the difference between two strings.
Defines the logger used by the top-level component of kea-dhcp-ddns.