summaryrefslogtreecommitdiff
path: root/test/test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-12 16:24:46 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-12 16:24:46 +0000
commit5038e68ad9eb66e007211c8f1b707612a0c01e29 (patch)
tree70d5aa5d3f414defc3d3cd0b34de0725bf8760a9 /test/test.cc
parenta8b629085c404d7a947ed242fbf64d8e0e91edcd (diff)
Remove sstream dependency.
Diffstat (limited to 'test/test.cc')
-rw-r--r--test/test.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/test.cc b/test/test.cc
index 3774a66..bc2acda 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
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,13 +19,13 @@
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE libsub_test
-#include <locked_sstream.h>
+#include "iso6937_tables.h"
+#include "compose.hpp"
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
#include <fstream>
#include <string>
#include <iostream>
-#include "iso6937_tables.h"
using std::string;
using std::cerr;
@@ -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) {
- locked_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;