15 #define BOOST_TEST_DYN_LINK 16 #define BOOST_TEST_MAIN 17 #define BOOST_TEST_MODULE PartitionTestSuite 18 #include <boost/test/unit_test.hpp> 22 namespace boost_utf = boost::unit_test;
34 #if defined(BOOST_VERSION) && BOOST_VERSION >= 105900 35 boost_utf::unit_test_log.set_format (boost_utf::OF_XML);
36 #else // BOOST_VERSION 37 boost_utf::unit_test_log.set_format (boost_utf::XML);
38 #endif // BOOST_VERSION 39 boost_utf::unit_test_log.set_threshold_level (boost_utf::log_test_units);
55 BOOST_AUTO_TEST_SUITE (master_test_suite)
63 std::string lLogFilename (
"PartitionTestSuite.log");
66 std::ofstream logOutputFile;
68 logOutputFile.open (lLogFilename.c_str());
69 logOutputFile.clear();
71 const std::string lLax1Str =
"los angeles";
72 const std::string lLax2Str =
"lso angeles";
73 const std::string lRio1Str =
"rio de janeiro";
74 const std::string lRio2Str =
"rio de janero";
75 const std::string lRek1Str =
"reikjavik";
76 const std::string lRek2Str =
"rekyavik";
77 const std::string lSfoRio1Str =
"san francisco rio de janeiro";
78 const std::string lSfoRio2Str =
"san francicso rio de janero";
79 const std::string lSfoRio3Str =
"sna francicso rio de janero";
80 const std::string lChelseaStr =
"chelsea municipal airport";
84 logOutputFile << lStringPartition << std::endl;
86 BOOST_CHECK_MESSAGE (lStringPartition.
size() == 16,
87 "The partition, for '" << lRio2Str
88 <<
"', should contain a single list." 89 <<
" However, its size is " << lStringPartition.
size()
94 logOutputFile << lAnotherStringPartition << std::endl;
97 logOutputFile.close();
101 BOOST_AUTO_TEST_SUITE_END()
BOOST_GLOBAL_FIXTURE(UnitTestConfig)
BOOST_AUTO_TEST_CASE(partition_small_string)
std::ofstream utfReportStream("PartitionTestSuite_utfresults.xml")