Try to fix static build.
[libsub.git] / test / test.cc
index 423906b02cf3305a14072908221483ed40d09395..6bb8b5bb4db3d812e2f5d64c23fd21a61fd152ce 100644 (file)
 #define BOOST_TEST_DYN_LINK
 #define BOOST_TEST_MODULE libsub_test
 #include <boost/test/unit_test.hpp>
+#include <boost/filesystem.hpp>
 #include <fstream>
 #include <string>
+#include "iso6937_tables.h"
 
 using std::string;
+using std::cerr;
 using std::ifstream;
 using std::getline;
 
-string private_test;
+boost::filesystem::path private_test;
 
 struct TestConfig
 {
@@ -38,14 +41,27 @@ struct TestConfig
                } else {
                        BOOST_TEST_MESSAGE ("Private data libsub-test-private not found; some tests will not run");
                }
+
+               sub::make_iso6937_tables ();
        }
 };
 
 BOOST_GLOBAL_FIXTURE (TestConfig);
 
 void
-check_text (string a, string b)
+check_text (boost::filesystem::path a, boost::filesystem::path b)
 {
+       if (!boost::filesystem::exists (a)) {
+               cerr << "File not found: " << a << "\n";
+       }
+
+       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 ());