mirror of https://github.com/ecmwf/eccodes.git
Testing: Increase coverage: JPEG decoding
This commit is contained in:
parent
e078c6af64
commit
5cbc79fd36
|
@ -273,19 +273,17 @@ cleanup:
|
|||
return code;
|
||||
}
|
||||
|
||||
#else
|
||||
#else // HAVE_LIBJASPER
|
||||
|
||||
int grib_jasper_decode(grib_context* c, unsigned char* buf, const size_t* buflen, double* val, const size_t* n_vals)
|
||||
{
|
||||
grib_context_log(c, GRIB_LOG_ERROR,
|
||||
"grib_accessor_data_jpeg2000_packing: JasPer JPEG support not enabled.");
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_jasper_decode: JasPer JPEG support not enabled.");
|
||||
return GRIB_FUNCTIONALITY_NOT_ENABLED;
|
||||
}
|
||||
|
||||
int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper)
|
||||
{
|
||||
grib_context_log(c, GRIB_LOG_ERROR,
|
||||
"grib_accessor_data_jpeg2000_packing: JasPer JPEG support not enabled.");
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_jasper_encode: JasPer JPEG support not enabled.");
|
||||
return GRIB_FUNCTIONALITY_NOT_ENABLED;
|
||||
}
|
||||
|
||||
|
|
|
@ -546,13 +546,13 @@ cleanup:
|
|||
|
||||
int grib_openjpeg_decode(grib_context* c, unsigned char* buf, const size_t* buflen, double* val, const size_t* n_vals)
|
||||
{
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_openjpeg_encoding.c: OpenJPEG JPEG support not enabled.");
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_openjpeg_decode: OpenJPEG JPEG support not enabled.");
|
||||
return GRIB_FUNCTIONALITY_NOT_ENABLED;
|
||||
}
|
||||
|
||||
int grib_openjpeg_encode(grib_context* c, j2k_encode_helper* helper)
|
||||
{
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_openjpeg_encoding.c: OpenJPEG JPEG support not enabled.");
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "grib_openjpeg_encode: OpenJPEG JPEG support not enabled.");
|
||||
return GRIB_FUNCTIONALITY_NOT_ENABLED;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,5 +156,15 @@ ECCODES_GRIB_DUMP_JPG_FILE=$tempDump ${tools_dir}/grib_copy -r $data_dir/jpeg.g
|
|||
[ -f $tempDump ]
|
||||
rm -f $tempDump
|
||||
|
||||
# Check Jasper decoding when it is disabled
|
||||
if [ $HAVE_LIBJASPER -eq 0 ]; then
|
||||
set +e
|
||||
ECCODES_GRIB_JPEG=jasper ${tools_dir}/grib_get -n statistics $data_dir/jpeg.grib2 > $tempDump 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -ne 0 ]
|
||||
grep -q "JasPer JPEG support not enabled" $tempDump
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
rm -f $tempFilt $tempGrib
|
||||
rm -f $tempFilt $tempGrib $tempDump
|
||||
|
|
Loading…
Reference in New Issue