Remove support for non-C99 compilers (like VS2010) that don't support snprintf()
[openjpeg.git] / tests / conformance / CMakeLists.txt
index 358a3f353c4f64363c1bd0f366353c7b2931c721..548a93d215acb76fa59a5d615d01f7d3ebf0e5cd 100644 (file)
@@ -8,7 +8,7 @@ set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
 set(INPUT_CONF ${OPJ_DATA_ROOT}/input/conformance)
 
 
-# List of components by file (normaly p0_13.j2k have 257 components but for this
+# List of components by file (normally p0_13.j2k have 257 components but for this
 #set of test we consider only 4)
 set( CP0_nbC_list "not_used;1;1;1;3;4;4;3;3;1;3;1;1;4;3;1;1")
 set( CP1_nbC_list "not_used;1;3;4;1;3;3;2")
@@ -426,7 +426,8 @@ endforeach()
 # compare to ref file
 # non regression comparison
 
-# Tolerances given by Table G.1
+# Tolerances given by Part 4 - Table G.1
+# Peak is set to 4 only
 
 foreach(numFileJP2 RANGE 1 9)
 
@@ -434,13 +435,12 @@ foreach(numFileJP2 RANGE 1 9)
   set( filenameInput "file${numFileJP2}.jp2" )
   set( filenameRef   jp2_${numFileJP2}.tif )
 
-  # Get corresponding tests parameters
-  list(GET JP2_PEAK_list ${numFileJP2}  PEAK_limit)
-
   add_test(NAME ETS-JP2-${filenameInput}-decode
     COMMAND opj_decompress
     -i ${INPUT_CONF}/${filenameInput}
     -o ${TEMP}/${filenameInput}.tif
+    -p 8S
+    -force-rgb
   )
 
   add_test(NAME ETS-JP2-${filenameInput}-compare2ref
@@ -449,7 +449,7 @@ foreach(numFileJP2 RANGE 1 9)
     -t ${TEMP}/${filenameInput}.tif
     -n 3
     -p 4:4:4
-    -m 4:4:4
+    -m 1:1:1
     -s b_t_
   )
 
@@ -510,20 +510,33 @@ foreach(kdu_file ${kdu_j2k_conf_files})
   set( filenameInput "${kdu_file}.j2c" )
   set( filenameRef   "${kdu_file}.ppm" )
 
+       if("${kdu_file}" STREQUAL "a6_mono_colr")
+    set(kdu_test_args -upsample -split-pnm )
+  else()
+    set(kdu_test_args -upsample )
+  endif()
+
   add_test(NAME ETS-KDU-${filenameInput}-decode
     COMMAND opj_decompress
     -i ${INPUT_CONF}/${filenameInput}
     -o ${TEMP}/${filenameInput}.ppm
+    ${kdu_test_args}
   )
 
+  if("${kdu_file}" STREQUAL "a6_mono_colr")
+    set(kdu_test_args -n 4 -s b_t_ )
+    set(kdu_test_args_tol -p 4:4:4:4 -m 1:1:1:1)
+  else()
+    set(kdu_test_args -n 1 )
+    set(kdu_test_args_tol -p 4:4:4 -m 1:1:1)
+  endif()
+
   add_test(NAME ETS-KDU-${filenameInput}-compare2ref
     COMMAND compare_images
     -b ${BASELINE_CONF}/${filenameRef}
     -t ${TEMP}/${filenameInput}.ppm
-    -n 3
-    -p 4:4:4
-    -m 4:4:4
-    -s b_t_
+    ${kdu_test_args}
+    ${kdu_test_args_tol}
   )
 
   set_tests_properties(ETS-KDU-${filenameInput}-compare2ref
@@ -534,9 +547,8 @@ foreach(kdu_file ${kdu_j2k_conf_files})
     COMMAND compare_images
     -b ${BASELINE_NR}/opj_${filenameRef}
     -t ${TEMP}/${filenameInput}.ppm
-    -n 3
+    ${kdu_test_args}
     -d
-    -s b_t_
   )
 
   set_tests_properties(NR-KDU-${filenameInput}-compare2base
@@ -544,13 +556,68 @@ foreach(kdu_file ${kdu_j2k_conf_files})
     ETS-KDU-${filenameInput}-decode)
 endforeach()
 
+#--------------------------------------------------------------------------
+# Tests about Richter/J2K file
+# try to decode
+# compare to ref file
+# non regression comparison
+
+# Tolerances given by ???
+
+set(richter_jp2_conf_files
+  subsampling_1
+  subsampling_2
+  zoo1
+  zoo2
+)
+
+foreach(r_file ${richter_jp2_conf_files})
+
+  # Build filenames
+  set( filenameInput "${r_file}.jp2" )
+  set( filenameRef   "${r_file}.ppm" )
+
+  add_test(NAME ETS-RIC-${filenameInput}-decode
+    COMMAND opj_decompress
+    -i ${INPUT_CONF}/${filenameInput}
+    -o ${TEMP}/${filenameInput}.ppm
+  )
+
+  set(ric_test_args -n 1)
+
+  add_test(NAME ETS-RIC-${filenameInput}-compare2ref
+    COMMAND compare_images
+    -b ${BASELINE_CONF}/${filenameRef}
+    -t ${TEMP}/${filenameInput}.ppm
+    ${ric_test_args}
+    -p 4:4:4
+    -m 2:2:2
+  )
+
+  set_tests_properties(ETS-RIC-${filenameInput}-compare2ref
+    PROPERTIES DEPENDS
+    ETS-RIC-${filenameInput}-decode)
+
+  add_test(NAME NR-RIC-${filenameInput}-compare2base
+    COMMAND compare_images
+    -b ${BASELINE_NR}/opj_${filenameRef}
+    -t ${TEMP}/${filenameInput}.ppm
+    ${ric_test_args}
+    -d
+  )
+
+  set_tests_properties(NR-RIC-${filenameInput}-compare2base
+    PROPERTIES DEPENDS
+    ETS-RIC-${filenameInput}-decode)
+endforeach()
+
 #--------------------------------------------------------------------------#
 #--------------------------------------------------------------------------#
 #--------------------------------------------------------------------------#
 
 #--------------------------------------------------------------------------
 # Tests about dump of profile 0 file
-# try to dump image and codestream informations into a file
+# try to dump image and codestream information into a file
 # non regression comparison this file to the baseline
 
 foreach(numFileP0 RANGE 1 16)
@@ -584,7 +651,7 @@ endforeach()
 
 #--------------------------------------------------------------------------
 # Tests about dump of profile 1 file
-# try to dump image and codestream informations into a file
+# try to dump image and codestream information into a file
 # non regression comparison this file to the baseline
 
 foreach(numFileP1 RANGE 1 7)
@@ -613,7 +680,7 @@ endforeach()
 
 #--------------------------------------------------------------------------
 # Tests about dump of JP2 file
-# try to dump image and codestream informations into a file
+# try to dump image and codestream information into a file
 # non regression comparison this file to the baseline
 
 foreach(numFileJP2 RANGE 1 9)