X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.cc;h=bc2acda81e4e8a786cc0be1db2b29c0f8117b8c5;hb=ad416ecd42e5cf8792fc36d4e4d16271639dd9c3;hp=9cbfe14758f3cd18a8912e5115c34544e1b4032f;hpb=3618ca642ef77e1a0fd56988bc1cd90a6b822fca;p=libsub.git diff --git a/test/test.cc b/test/test.cc index 9cbfe14..bc2acda 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2019 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,12 +19,13 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE libsub_test +#include "iso6937_tables.h" +#include "compose.hpp" #include #include #include #include #include -#include "iso6937_tables.h" using std::string; using std::cerr; @@ -34,7 +35,6 @@ using std::max; using std::hex; using std::ifstream; using std::getline; -using std::stringstream; boost::filesystem::path private_test; @@ -106,12 +106,10 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) BOOST_CHECK_EQUAL (r, this_time); for (uintmax_t i = 0; i < this_time; ++i) { - stringstream s; - s << "Files differ at offset " << (offset + i) - << "; reference is " << hex << ((int) ref_buffer[i]) - << ", check is " << hex << ((int) check_buffer[i]); - - BOOST_CHECK_MESSAGE (ref_buffer[i] == check_buffer[i], s.str ()); + string const s = String::compose ( + "Files differ at offset %1; reference is %2, check is %3", (offset + i), ((int) ref_buffer[i]), ((int) check_buffer[i]) + ); + BOOST_CHECK_MESSAGE (ref_buffer[i] == check_buffer[i], s); } offset += this_time;