summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-08-27 21:40:13 (GMT)
committerGennadiy Civil <misterg@google.com>2018-08-28 20:53:38 (GMT)
commit52f8183e7f3620cf03f321a2624eb0d4f7649f4c (patch)
tree831bb5f2bc560dc6d4bb0e6462544c34a74acf42 /googletest/include
parent167c5e8188beb5dae002ac7571457e3c26eb6a3f (diff)
downloadgoogletest-52f8183e7f3620cf03f321a2624eb0d4f7649f4c.zip
googletest-52f8183e7f3620cf03f321a2624eb0d4f7649f4c.tar.gz
googletest-52f8183e7f3620cf03f321a2624eb0d4f7649f4c.tar.bz2
Googletest export
Breaks Windows builds PiperOrigin-RevId: 210434120
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 1c2824d..9593a45 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -159,15 +159,15 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4275
#endif // GTEST_HAS_EXCEPTIONS
+namespace edit_distance {
// Returns the optimal edits to go from 'left' to 'right'.
// All edits cost the same, with replace having lower priority than
-// add/remove. Returns an approximation of the maximum memory used in
-// 'memory_usage' if non-null.
-// Uses a Dijkstra search, with a couple of simple bells and whistles added on.
-enum EditType { kEditMatch, kEditAdd, kEditRemove, kEditReplace };
+// add/remove.
+// Simple implementation of the Wagner-Fischer algorithm.
+// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+enum EditType { kMatch, kAdd, kRemove, kReplace };
GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
- const std::vector<size_t>& left, const std::vector<size_t>& right,
- size_t* memory_usage = NULL);
+ const std::vector<size_t>& left, const std::vector<size_t>& right);
// Same as above, but the input is represented as strings.
GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
@@ -179,6 +179,8 @@ GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
const std::vector<std::string>& right,
size_t context = 2);
+} // namespace edit_distance
+
// Calculate the diff between 'left' and 'right' and return it in unified diff
// format.
// If not null, stores in 'total_line_count' the total number of lines found