From ef258914b2391161d068d7d5c45f52d50cfb0e83 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 22 Aug 2011 13:13:00 +0000 Subject: [PATCH] Properly close bug #73, by providing a test for it. --- tests/conformance/CMakeLists.txt | 2 +- tests/nonregression/CMakeLists.txt | 56 +++++++++++++++++++----------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/tests/conformance/CMakeLists.txt b/tests/conformance/CMakeLists.txt index 63f6c456..1dcfe234 100644 --- a/tests/conformance/CMakeLists.txt +++ b/tests/conformance/CMakeLists.txt @@ -481,4 +481,4 @@ FOREACH(numFileP1 RANGE 1 7) PROPERTIES DEPENDS NR-${filenameInput}-dump) -ENDFOREACH(numFileP1 RANGE 1 7) \ No newline at end of file +ENDFOREACH(numFileP1 RANGE 1 7) diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index f8a67ceb..9a9e7f12 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -12,32 +12,46 @@ FILE(GLOB_RECURSE OPJ_DATA_NR_LIST "${INPUT_NR}/*.jp2" ) +# Define a list of file which should be gracefully rejected: +SET(BLACKLIST_JPEG200 + illegalcolortransform.j2k + ) + FOREACH(filepath ${OPJ_DATA_NR_LIST}) GET_FILENAME_COMPONENT(filename ${filepath} NAME) GET_FILENAME_COMPONENT(filenameSub ${filename} NAME_WE) - + STRING(REGEX MATCH ${filename} bad_jpeg2000 ${BLACKLIST_JPEG200}) + ADD_TEST(NR-${filename}-dump - ${EXECUTABLE_OUTPUT_PATH}/j2k_dump - -i ${filepath} - -o ${TEMP}/${filename}.txt - ) - - ADD_TEST(NR-${filename}-compare_dump2base - ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files - -b ${BASELINE_NR}/opj_${filenameSub}.txt - -t ${TEMP}/${filename}.txt - ) - - SET_TESTS_PROPERTIES(NR-${filename}-compare_dump2base - PROPERTIES DEPENDS - NR-${filename}-dump) - + ${EXECUTABLE_OUTPUT_PATH}/j2k_dump + -i ${filepath} + -o ${TEMP}/${filename}.txt + ) ADD_TEST(NR-${filename}-decode - ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image - -i ${filepath} - -o ${TEMP}/${filename}.pgx + ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image + -i ${filepath} + -o ${TEMP}/${filename}.pgx + ) + + IF(bad_jpeg2000) + SET_TESTS_PROPERTIES(NR-${filename}-dump + PROPERTIES WILL_FAIL TRUE) + SET_TESTS_PROPERTIES(NR-${filename}-decode + PROPERTIES WILL_FAIL TRUE) + ELSE(bad_jpeg2000) + # Only run this test when previous succeeds + ADD_TEST(NR-${filename}-compare_dump2base + ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files + -b ${BASELINE_NR}/opj_${filenameSub}.txt + -t ${TEMP}/${filename}.txt ) - + + SET_TESTS_PROPERTIES(NR-${filename}-compare_dump2base + PROPERTIES DEPENDS + NR-${filename}-dump) + + ENDIF(bad_jpeg2000) + # ADD_TEST(NR-${filename}-compare2base # ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages # -b ${BASELINE_NR}/opj_${filenameRef} @@ -51,4 +65,4 @@ FOREACH(filepath ${OPJ_DATA_NR_LIST}) # PROPERTIES DEPENDS # NR-${filename}-decode) -ENDFOREACH(filepath) \ No newline at end of file +ENDFOREACH(filepath)