This will allow for comparing decoded output to the original source when the
decoded size is not exactly the same as the original size.
---
 tests/Makefile    |    2 +-
 tests/fate-run.sh |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 7cb39ff..7166182 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -116,7 +116,7 @@ fate: $(FATE)
 
 $(FATE): avconv$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
        @echo "TEST    $(@:fate-%=%)"
-       $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" 
"$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' 
'$(THREAD_TYPE)' '$(CPUFLAGS)' '$(PSNR_SHIFT)' '$(PSNR_TARGET)'
+       $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" 
"$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' 
'$(THREAD_TYPE)' '$(CPUFLAGS)' '$(PSNR_SHIFT)' '$(PSNR_TARGET)' 
'$(SIZE_TOLERANCE)'
 
 fate-list:
        @printf '%s\n' $(sort $(FATE))
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 2edc4f0..055cf25 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -20,6 +20,7 @@ thread_type=${10:-frame+slice}
 cpuflags=${11:-all}
 psnr_shift=${12:-0}
 psnr_target=${13:-0}
+size_tolerance=${14:-0}
 
 outdir="tests/data/fate"
 outfile="${outdir}/${test}"
@@ -41,7 +42,9 @@ do_tiny_psnr(){
     size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
     compare $val $psnr_target $fuzz 2
     val_cmp=$?
-    if [ "$val_cmp" != 0 ] || [ $size1 != $size2 ]; then
+    compare $size1 $size2 $size_tolerance 0
+    size_cmp=$?
+    if [ "$val_cmp" != 0 ] || [ "$size_cmp" != 0 ]; then
         echo "$psnr"
         return 1
     fi
-- 
1.7.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to