summaryrefslogtreecommitdiff
path: root/test/test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-07 15:11:34 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-07 15:11:34 +0100
commit3618ca642ef77e1a0fd56988bc1cd90a6b822fca (patch)
tree105260637f41232d52e26cec0ce364d45d942dd3 /test/test.cc
parentd704110228aae2bc7cd2ebc8ccd23d78be4fef9b (diff)
Arch build fixes.
Diffstat (limited to 'test/test.cc')
-rw-r--r--test/test.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test.cc b/test/test.cc
index 693e5b2..9cbfe14 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -23,6 +23,7 @@
#include <boost/filesystem.hpp>
#include <fstream>
#include <string>
+#include <iostream>
#include "iso6937_tables.h"
using std::string;
@@ -63,10 +64,10 @@ check_text (boost::filesystem::path a, boost::filesystem::path b)
if (!boost::filesystem::exists (b)) {
cerr << "File not found: " << b << "\n";
}
-
+
BOOST_CHECK (boost::filesystem::exists (a));
BOOST_CHECK (boost::filesystem::exists (b));
-
+
ifstream p (a.c_str ());
ifstream q (b.c_str ());
@@ -91,7 +92,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
BOOST_CHECK (ref_file);
FILE* check_file = fopen (check.string().c_str(), "rb");
BOOST_CHECK (check_file);
-
+
int const buffer_size = 65536;
uint8_t* ref_buffer = new uint8_t[buffer_size];
uint8_t* check_buffer = new uint8_t[buffer_size];
@@ -109,7 +110,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
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 ());
}