diff options
Diffstat (limited to 'Tests/FindJasper')
-rw-r--r-- | Tests/FindJasper/Test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/FindJasper/Test/main.c | 18 |
2 files changed, 7 insertions, 13 deletions
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 <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); } |