diff options
| author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-02-26 10:48:06 +0000 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-02-26 10:48:06 +0000 |
| commit | 820c04c6799ea38aacd4e5d637073e6ab1ec643c (patch) | |
| tree | feb3724296e60653b5eb615b0153db744fb86b0c /tests/nonregression | |
| parent | 9d848e3f5e34c93d206ab7a2961f1f31ec56f820 (diff) | |
[trunk] Update file extension function to handle cases where filename containes multiples dots.
Update issue 250
Diffstat (limited to 'tests/nonregression')
| -rw-r--r-- | tests/nonregression/CMakeLists.txt | 15 | ||||
| -rw-r--r-- | tests/nonregression/test_suite.ctest.in | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index 6116bf8c..f756fe81 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -18,8 +18,16 @@ find_package(KAKADU) # GENERATION OF THE TEST SUITE (DUMP) # Dump all files with the selected extension inside the input directory +# technically opj_dump should simply parse these one, since syntax is ok. +set(BLACKLIST_JPEG2000_TMP + 2539.pdf.SIGFPE.706.1712.jp2 + 0290cb77c5df21828fa74cf2ab2c84d8.SIGFPE.d25.31.jp2 + 26ccf3651020967f7778238ef5af08af.SIGFPE.d25.527.jp2 + ) + # Define a list of file which should be gracefully rejected: set(BLACKLIST_JPEG2000 + ${BLACKLIST_JPEG2000_TMP} broken.jp2 broken2.jp2 broken3.jp2 @@ -29,6 +37,7 @@ set(BLACKLIST_JPEG2000 gdal_fuzzer_check_number_of_tiles.jp2 gdal_fuzzer_unchecked_numresolutions.jp2 mem-b2ace68c-1381.jp2 + 1851.pdf.SIGSEGV.ce9.948.jp2 ) file(GLOB_RECURSE OPJ_DATA_NR_LIST @@ -40,7 +49,11 @@ file(GLOB_RECURSE OPJ_DATA_NR_LIST foreach(INPUT_FILENAME ${OPJ_DATA_NR_LIST}) get_filename_component(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME) - get_filename_component(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE) + #get_filename_component(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE) + # cannot use longest extension function, since some name contains multiples + # dots. Instead write out own shortest extension function: + string(FIND ${INPUT_FILENAME_NAME} "." SHORTEST_EXT_POS REVERSE) + string(SUBSTRING ${INPUT_FILENAME_NAME} 0 ${SHORTEST_EXT_POS} INPUT_FILENAME_NAME_WE) string(REGEX MATCH ${INPUT_FILENAME_NAME} bad_jpeg2000 ${BLACKLIST_JPEG2000}) # Dump the input image diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index 0237b95f..6348ff59 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -101,7 +101,7 @@ opj_decompress -i @INPUT_NR_PATH@/issue206_image-000.jp2 -o @TEMP_PATH@/issue20 opj_decompress -i @INPUT_NR_PATH@/issue205.jp2 -o @TEMP_PATH@/issue205.jp2.pgx # issue 225 (sumatrapdf) !opj_decompress -i @INPUT_NR_PATH@/451.pdf.SIGSEGV.5b5.3723.jp2 -o @TEMP_PATH@/451.pdf.SIGSEGV.5b5.3723.jp2.pgx -opj_decompress -i @INPUT_NR_PATH@/1888.pdf.asan.35.988.jp2 -o @TEMP_PATH@/1888.pdf.asan.35.988.jp2.pgx +!opj_decompress -i @INPUT_NR_PATH@/1888.pdf.asan.35.988.jp2 -o @TEMP_PATH@/1888.pdf.asan.35.988.jp2.pgx !opj_decompress -i @INPUT_NR_PATH@/2539.pdf.SIGFPE.706.1712.jp2 -o @TEMP_PATH@/2539.pdf.SIGFPE.706.1712.jp2.pgx !opj_decompress -i @INPUT_NR_PATH@/2236.pdf.SIGSEGV.398.1376.jp2 -o @TEMP_PATH@/2236.pdf.SIGSEGV.398.1376.jp2.pgx !opj_decompress -i @INPUT_NR_PATH@/1336.pdf.asan.47.376.jp2 -o @TEMP_PATH@/1336.pdf.asan.47.376.jp2.pgx |
