From c6408577d61422fb93d07139e1f377ee80eb592a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 10 Apr 2024 12:14:07 -0400 Subject: ci: Enable FindJasper test on Fedora --- .gitlab/ci/configure_fedora39_makefiles.cmake | 1 + Tests/FindJasper/Test/CMakeLists.txt | 2 +- Tests/FindJasper/Test/main.c | 18 ++++++------------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.gitlab/ci/configure_fedora39_makefiles.cmake b/.gitlab/ci/configure_fedora39_makefiles.cmake index 39fe642..4e18c83 100644 --- a/.gitlab/ci/configure_fedora39_makefiles.cmake +++ b/.gitlab/ci/configure_fedora39_makefiles.cmake @@ -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 "") diff --git a/Tests/FindJasper/Test/CMakeLists.txt b/Tests/FindJasper/Test/CMakeLists.txt index 1e9467d..93873bf 100644 --- a/Tests/FindJasper/Test/CMakeLists.txt +++ b/Tests/FindJasper/Test/CMakeLists.txt @@ -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) diff --git a/Tests/FindJasper/Test/main.c b/Tests/FindJasper/Test/main.c index 242ff7d..b9dbe1e 100644 --- a/Tests/FindJasper/Test/main.c +++ b/Tests/FindJasper/Test/main.c @@ -1,17 +1,11 @@ -#include -// clang-format off -#include #include -// clang-format on +#include 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); } -- cgit v0.12