ci: Enable FindJasper test on Fedora

This commit is contained in:
Brad King 2024-04-10 12:14:07 -04:00
parent 28f4941bc7
commit c6408577d6
3 changed files with 8 additions and 13 deletions

View File

@ -48,6 +48,7 @@ set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
set(CMake_TEST_FindICU "ON" CACHE BOOL "")
set(CMake_TEST_FindImageMagick "ON" CACHE BOOL "")
set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
set(CMake_TEST_FindJasper "ON" CACHE BOOL "")
set(CMake_TEST_FindJNI "ON" CACHE BOOL "")
set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")

View File

@ -4,7 +4,7 @@ include(CTest)
find_package(Jasper)
add_definitions(-DCMAKE_EXPECTED_JASPER_VERSION=${JASPER_VERSION_STRING})
add_definitions(-DCMAKE_EXPECTED_JASPER_VERSION="${JASPER_VERSION_STRING}")
add_executable(test_jasper_tgt main.c)
target_link_libraries(test_jasper_tgt Jasper::Jasper)

View File

@ -1,17 +1,11 @@
#include <assert.h>
// clang-format off
#include <stdio.h>
#include <jasper/jasper.h>
// clang-format on
#include <string.h>
int main(void)
{
/* Without any JPEG file to open, test that the call fails as
expected. This tests that linking worked. */
jas_init();
jas_image_t* img = jas_image_create0();
jas_image_destroy(img);
jas_cleanup();
return (JAS_VERSION != CMAKE_EXPECTED_JASPER_VERSION);
jas_conf_clear();
jas_conf_set_max_mem_usage(0x100000);
jas_init_library();
jas_cleanup_library();
return strcmp(JAS_VERSION, CMAKE_EXPECTED_JASPER_VERSION);
}