From 89e898ab203619bec4dc00932aac7f3ab087f612 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 26 Apr 2019 09:45:43 +1000 Subject: [PATCH] tools/compare: print full match data --- tools/compare.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/compare.cpp b/tools/compare.cpp index a9ab558..ca501b6 100644 --- a/tools/compare.cpp +++ b/tools/compare.cpp @@ -53,7 +53,9 @@ namespace emory { struct side { IdT id; chunk data; - } src, dst; + }; + + side src, dst; struct src_equality { @@ -98,6 +100,16 @@ namespace emory { }; + template + std::ostream& + operator<< (std::ostream &os, match const &val) + { + return os << "{ src: { id: " << val.src.id << ", data: " << val.src.data << " }" + << ", dst: { id: " << val.dst.id << ", data: " << val.dst.data << " }" + << " }"; + } + + std::vector> common (map const &a, map const &b); } @@ -246,7 +258,7 @@ int main (int argc, char const **argv) std::size_t matching = 0; std::vector source_bytes (argc - ARGS_SOURCE, 0); for (auto const &i: found) { - std::cout << i.dst.data << '\n'; + std::cout << i << '\n'; auto const size = i.dst.data.offset.second - i.dst.data.offset.first; matching += size; source_bytes[i.src.id - ARGS_SOURCE] += size;