cpp tests: fix test to respect DEFINES
This commit is contained in:
parent
5c157eae59
commit
d407cfa456
1 changed files with 36 additions and 29 deletions
|
@ -25,6 +25,8 @@ int main(int argc, char** argv)
|
|||
{
|
||||
BOOST_TEST(set_working_dir(args));
|
||||
|
||||
|
||||
#if defined(HAVE_JPEG)
|
||||
should_throw = "./tests/cpp_tests/data/blank.jpg";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
|
@ -38,7 +40,9 @@ int main(int argc, char** argv)
|
|||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PNG)
|
||||
should_throw = "./tests/cpp_tests/data/blank.png";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
|
@ -52,35 +56,6 @@ int main(int argc, char** argv)
|
|||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
|
||||
should_throw = "./tests/cpp_tests/data/blank.tiff";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
BOOST_TEST( type );
|
||||
try
|
||||
{
|
||||
std::auto_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(should_throw,*type));
|
||||
if (reader.get()) BOOST_TEST( false );
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
|
||||
should_throw = "./tests/cpp_tests/data/blank.webp";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
BOOST_TEST( type );
|
||||
try
|
||||
{
|
||||
std::auto_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(should_throw,*type));
|
||||
BOOST_TEST( false );
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
|
||||
should_throw = "./tests/data/images/xcode-CgBI.png";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
|
@ -94,7 +69,39 @@ int main(int argc, char** argv)
|
|||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TIFF)
|
||||
should_throw = "./tests/cpp_tests/data/blank.tiff";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
BOOST_TEST( type );
|
||||
try
|
||||
{
|
||||
std::auto_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(should_throw,*type));
|
||||
if (reader.get()) BOOST_TEST( false );
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WEBP)
|
||||
should_throw = "./tests/cpp_tests/data/blank.webp";
|
||||
BOOST_TEST( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
BOOST_TEST( type );
|
||||
try
|
||||
{
|
||||
std::auto_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(should_throw,*type));
|
||||
BOOST_TEST( false );
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
BOOST_TEST( true );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (std::exception const & ex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue