font_registration test: only modify severity temporarily

This commit is contained in:
Dane Springmeyer 2014-08-11 18:51:38 -07:00
parent 9253ce10f8
commit 60b72524c1

View file

@ -23,7 +23,7 @@ int main(int argc, char** argv)
try try
{ {
mapnik::logger logger; mapnik::logger logger;
logger.set_severity(mapnik::logger::none); mapnik::logger::severity_type original_severity = logger.get_severity();
BOOST_TEST(set_working_dir(args)); BOOST_TEST(set_working_dir(args));
@ -45,6 +45,8 @@ int main(int argc, char** argv)
BOOST_TEST( face_names.size() == 0 ); BOOST_TEST( face_names.size() == 0 );
// directories without fonts // directories without fonts
// silence warnings here by altering the logging severity
logger.set_severity(mapnik::logger::none);
std::string src("src"); std::string src("src");
// an empty directory will not return true // an empty directory will not return true
// we need to register at least one font and not fail on any // we need to register at least one font and not fail on any
@ -62,6 +64,9 @@ int main(int argc, char** argv)
BOOST_TEST( mapnik::freetype_engine::register_fonts("tests/data/fonts/intentionally-broken.ttf") == false ); BOOST_TEST( mapnik::freetype_engine::register_fonts("tests/data/fonts/intentionally-broken.ttf") == false );
BOOST_TEST( mapnik::freetype_engine::face_names().size() == 0 ); BOOST_TEST( mapnik::freetype_engine::face_names().size() == 0 );
// now restore the original severity
logger.set_severity(original_severity);
// register unifont, since we know it sits in the root fonts/ dir // register unifont, since we know it sits in the root fonts/ dir
BOOST_TEST( mapnik::freetype_engine::register_fonts(fontdir) ); BOOST_TEST( mapnik::freetype_engine::register_fonts(fontdir) );
face_names = mapnik::freetype_engine::face_names(); face_names = mapnik::freetype_engine::face_names();