aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-09 23:10:34 +0100
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-11 21:52:26 +0100
commitdb6be5416caf32ac85c3f9546e86ef9db06a7e2a (patch)
tree2641061742328c936c651076f83fe62ce7ec2b1b /tests
parentb54effba4f173560361a697304c0395677e12d6c (diff)
downloadffmpeg-db6be5416caf32ac85c3f9546e86ef9db06a7e2a.tar.gz
fate: add opt-test
Diffstat (limited to 'tests')
-rw-r--r--tests/fate/libavutil.mak4
-rw-r--r--tests/ref/fate/opt90
2 files changed, 94 insertions, 0 deletions
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 63a4dd6e5b..eadebdb158 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -107,6 +107,10 @@ FATE_LIBAVUTIL += fate-xtea
fate-xtea: libavutil/xtea-test$(EXESUF)
fate-xtea: CMD = run libavutil/xtea-test
+FATE_LIBAVUTIL += fate-opt
+fate-opt: libavutil/opt-test$(EXESUF)
+fate-opt: CMD = run libavutil/opt-test
+
FATE_LIBAVUTIL += $(FATE_LIBAVUTIL-yes)
FATE-$(CONFIG_AVUTIL) += $(FATE_LIBAVUTIL)
fate-libavutil: $(FATE_LIBAVUTIL)
diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt
index e69de29bb2..6523390dde 100644
--- a/tests/ref/fate/opt
+++ b/tests/ref/fate/opt
@@ -0,0 +1,90 @@
+Testing default values
+num=0
+toggle=1
+string=default
+flags=1
+rational=1/1
+video_rate=25/1
+width=200 height=300
+pix_fmt=0bgr
+sample_fmt=s16
+duration=1000
+color=255 192 203 255
+channel_layout=311=311
+binary=62 69 6e 0
+binary_size=4
+num64=1
+flt=0.333333
+dbl=0.333333
+
+Testing av_set_options_string()
+OK ''
+Error ':'
+Error '='
+Error 'foo=:'
+Error ':=foo'
+Error '=foo'
+Error 'foo='
+Error 'foo'
+Error 'foo=val'
+Error 'foo==val'
+Error 'toggle=:'
+OK 'string=:'
+Error 'toggle=1 : foo'
+Error 'toggle=100'
+Error 'toggle==1'
+OK 'flags=+mu-lame : num=42: toggle=0'
+OK 'num=42 : string=blahblah'
+Error 'rational=0 : rational=1/2 : rational=1/-1'
+Error 'rational=-1/0'
+OK 'size=1024x768'
+OK 'size=pal'
+Error 'size=bogus'
+OK 'pix_fmt=yuv420p'
+OK 'pix_fmt=2'
+Error 'pix_fmt=bogus'
+OK 'sample_fmt=s16'
+OK 'sample_fmt=2'
+Error 'sample_fmt=bogus'
+OK 'video_rate=pal'
+OK 'video_rate=25'
+OK 'video_rate=30000/1001'
+OK 'video_rate=30/1.001'
+Error 'video_rate=bogus'
+Error 'duration=bogus'
+OK 'duration=123.45'
+OK 'duration=1\:23\:45.67'
+OK 'color=blue'
+OK 'color=0x223300'
+OK 'color=0x42FF07AA'
+OK 'cl=stereo+downmix'
+Error 'cl=foo'
+Error 'bin=boguss'
+Error 'bin=111'
+OK 'bin=ffff'
+Error 'num64=bogus'
+OK 'num64=44'
+OK 'num64=44.4'
+Error 'num64=-1'
+Error 'num64=101'
+Error 'flt=bogus'
+OK 'flt=2'
+OK 'flt=2.2'
+Error 'flt=-1'
+Error 'flt=101'
+Error 'dbl=bogus'
+OK 'dbl=2'
+OK 'dbl=2.2'
+Error 'dbl=-1'
+Error 'dbl=101'
+
+Testing av_opt_set_from_string()
+OK ''
+OK '5'
+OK '5:hello'
+OK '5:hello:size=pal'
+Error '5:size=pal:hello'
+Error ':'
+Error '='
+OK ' 5 : hello : size = pal '
+Error 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42'