meson: fix tests when zlib is disabled
This sometimes shows up in CI if zlib is not found. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
3633f8d2c2
commit
cfc0ef0b65
@ -23,7 +23,6 @@ test_sources = files(
|
|||||||
'test_image_int.cpp',
|
'test_image_int.cpp',
|
||||||
'test_jp2image.cpp',
|
'test_jp2image.cpp',
|
||||||
'test_jp2image_int.cpp',
|
'test_jp2image_int.cpp',
|
||||||
'test_pngimage.cpp',
|
|
||||||
'test_safe_op.cpp',
|
'test_safe_op.cpp',
|
||||||
'test_slice.cpp',
|
'test_slice.cpp',
|
||||||
'test_tiffheader.cpp',
|
'test_tiffheader.cpp',
|
||||||
@ -39,6 +38,12 @@ if get_option('video')
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if zlib_dep.found()
|
||||||
|
test_sources += files(
|
||||||
|
'test_pngimage.cpp',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
if host_machine.system() == 'windows' and get_option('default_library') != 'static'
|
if host_machine.system() == 'windows' and get_option('default_library') != 'static'
|
||||||
test_sources += int_lib
|
test_sources += int_lib
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -22,7 +22,9 @@ TEST(TheImageFactory, createsInstancesForFewSupportedTypesInMemory) {
|
|||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::jpeg));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::jpeg));
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::exv));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::exv));
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::pgf));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::pgf));
|
||||||
|
#ifdef EXV_HAVE_LIBZ
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::png));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::png));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(TheImageFactory, cannotCreateInstancesForMostTypesInMemory) {
|
TEST(TheImageFactory, cannotCreateInstancesForMostTypesInMemory) {
|
||||||
@ -66,7 +68,9 @@ TEST(TheImageFactory, createsInstancesForFewSupportedTypesInFiles) {
|
|||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::jpeg, filePath));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::jpeg, filePath));
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::exv, filePath));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::exv, filePath));
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::pgf, filePath));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::pgf, filePath));
|
||||||
|
#ifdef EXV_HAVE_LIBZ
|
||||||
EXPECT_NO_THROW(ImageFactory::create(ImageType::png, filePath));
|
EXPECT_NO_THROW(ImageFactory::create(ImageType::png, filePath));
|
||||||
|
#endif
|
||||||
|
|
||||||
EXPECT_TRUE(fs::remove(filePath));
|
EXPECT_TRUE(fs::remove(filePath));
|
||||||
}
|
}
|
||||||
@ -116,9 +120,11 @@ TEST(TheImageFactory, loadInstancesDifferentImageTypes) {
|
|||||||
EXPECT_EQ(ImageType::tiff, ImageFactory::getType(imagePath));
|
EXPECT_EQ(ImageType::tiff, ImageFactory::getType(imagePath));
|
||||||
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
|
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
|
||||||
|
|
||||||
|
#ifdef EXV_HAVE_LIBZ
|
||||||
imagePath = (testData / "exiv2-bug1074.png").string();
|
imagePath = (testData / "exiv2-bug1074.png").string();
|
||||||
EXPECT_EQ(ImageType::png, ImageFactory::getType(imagePath));
|
EXPECT_EQ(ImageType::png, ImageFactory::getType(imagePath));
|
||||||
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
|
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
|
||||||
|
#endif
|
||||||
|
|
||||||
imagePath = (testData / "BlueSquare.xmp").string();
|
imagePath = (testData / "BlueSquare.xmp").string();
|
||||||
EXPECT_EQ(ImageType::xmp, ImageFactory::getType(imagePath));
|
EXPECT_EQ(ImageType::xmp, ImageFactory::getType(imagePath));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user