15 #include <boost/filesystem.hpp>
17 #define BOOST_TEST_DYN_LINK
18 #define BOOST_TEST_MAIN
19 #define BOOST_TEST_MODULE SliceTestSuite
20 #include <boost/test/unit_test.hpp>
26 namespace boost_utf = boost::unit_test;
38 boost_utf::unit_test_log.set_format (boost_utf::XML);
39 boost_utf::unit_test_log.set_threshold_level (boost_utf::log_test_units);
66 BOOST_AUTO_TEST_SUITE (master_test_suite)
74 const std::string lLogFilename (
"SliceTestSuite.log");
77 std::ofstream logOutputFile;
79 logOutputFile.open (lLogFilename.c_str());
80 logOutputFile.clear();
89 const std::string lLax1Str =
"los angeles";
90 const std::string lLax2Str =
"lso angeles";
91 const std::string lRio1Str =
"rio de janeiro";
92 const std::string lRio2Str =
"rio de janero";
93 const std::string lRek1Str =
"reikjavik";
94 const std::string lRek2Str =
"rekyavik";
95 const std::string lSfoRio1Str =
"san francisco rio de janeiro";
96 const std::string lSfoRio2Str =
"san francicso rio de janero";
97 const std::string lSfoRio3Str =
"sna francicso rio de janero";
98 const std::string lChelseaStr =
"chelsea municipal airport";
105 Xapian::Database lXapianDatabase (lTravelDBFilePath);
111 BOOST_CHECK_MESSAGE (lQuerySlices.
size() == 5,
112 "The query ('" << lSfoRio1Str
113 <<
"') should contain 5 slices."
114 <<
" However, its size is " << lQuerySlices.
size()
121 BOOST_CHECK_MESSAGE (lAnotherQuerySlices.size() == 3,
122 "The query ('" << lChelseaStr
123 <<
"') should contain 3 slices."
124 <<
" However, its size is " << lAnotherQuerySlices.size()
128 logOutputFile.close();
132 BOOST_AUTO_TEST_SUITE_END()
BOOST_GLOBAL_FIXTURE(UnitTestConfig)
const std::string X_XAPIAN_DB_FP(OPENTREP::DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH)
const std::string DEFAULT_OPENTREP_SQLITE_DB_FILEPATH
Interface for the OPENTREP Services.
BOOST_AUTO_TEST_CASE(slice_small_string)
const std::string DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH
const std::string X_SQLITE_DB_FP(OPENTREP::DEFAULT_OPENTREP_SQLITE_DB_FILEPATH)
std::ofstream utfReportStream("SliceTestSuite_utfresults.xml")