From 15ca93e3b9a766ba93aa40e626f41ba5bcbfa0b8 Mon Sep 17 00:00:00 2001 From: rulrich Date: Fri, 22 Jan 2021 22:35:34 +0100 Subject: [PATCH] style --- .../compress_stream/test/src/main.cpp | 123 +++++++++--------- 1 file changed, 60 insertions(+), 63 deletions(-) diff --git a/readLib/externals/compress_stream/test/src/main.cpp b/readLib/externals/compress_stream/test/src/main.cpp index 04a3aaf..10a467e 100644 --- a/readLib/externals/compress_stream/test/src/main.cpp +++ b/readLib/externals/compress_stream/test/src/main.cpp @@ -23,81 +23,78 @@ #include "gzstream.hpp" #include "bzstream.hpp" - #include #include #include #include -template -bool -range_equal(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2) -{ - while(first1 != last1 && first2 != last2) - { - if(*first1 != *first2) return false; - ++first1; - ++first2; - } - return (first1 == last1) && (first2 == last2); +template +bool range_equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, + InputIterator2 last2) { + while (first1 != last1 && first2 != last2) { + if (*first1 != *first2) return false; + ++first1; + ++first2; + } + return (first1 == last1) && (first2 == last2); } -bool compare_files(const std::string& filename1, const std::string& filename2) -{ - std::ifstream file1(filename1); - std::ifstream file2(filename2); +bool compare_files(const std::string& filename1, const std::string& filename2) { + std::ifstream file1(filename1); + std::ifstream file2(filename2); - std::istreambuf_iterator begin1(file1); - std::istreambuf_iterator begin2(file2); + std::istreambuf_iterator begin1(file1); + std::istreambuf_iterator begin2(file2); - std::istreambuf_iterator end; + std::istreambuf_iterator end; - return range_equal(begin1, end, begin2, end); + return range_equal(begin1, end, begin2, end); } -void test_out(bool result, std::string message) -{ - if(result) - { - std::cout<<"\033[32m"<