[FFmpeg-devel] Selftest coverage for libavutil/fifo.c

Submitted by Thomas Turner on Oct. 10, 2016, 11:31 a.m.

Details

Message ID 1476099089-20407-1-git-send-email-thomastdt@gmail.com
State Superseded
Headers show

Commit Message

Thomas Turner Oct. 10, 2016, 11:31 a.m.
code coverage for av_fifo_grow(...), av_fifo_generic_peek(...)
---
 libavutil/Makefile       | 1 +
 libavutil/tests/fifo2.c  | 3 ++-
 tests/fate/libavutil.mak | 4 ++++
 tests/ref/fate/fifo2     | 3 +++
 4 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/fifo2

Comments

Michael Niedermayer Oct. 10, 2016, 10:29 p.m.
On Mon, Oct 10, 2016 at 04:31:29AM -0700, Thomas Turner wrote:
> code coverage for av_fifo_grow(...), av_fifo_generic_peek(...)
> ---
>  libavutil/Makefile       | 1 +
>  libavutil/tests/fifo2.c  | 3 ++-
>  tests/fate/libavutil.mak | 4 ++++
>  tests/ref/fate/fifo2     | 3 +++
>  4 files changed, 10 insertions(+), 1 deletion(-)
>  create mode 100644 tests/ref/fate/fifo2

this patch does not apply cleanly to git master

    Applying: Selftest coverage for libavutil/fifo.c
    .git/rebase-apply/patch:30: trailing whitespace.
        if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) !=
    .git/rebase-apply/patch:56: trailing whitespace.
    fifo->buffer: 0, 2, 4, 6, 8, 10, 12,
    fatal: sha1 information is lacking or useless (libavutil/tests/fifo2.c).
    error: could not build fake ancestor
    Patch failed at 0001 Selftest coverage for libavutil/fifo.c
    The copy of the patch that failed is found in: .git/rebase-apply/patch
    When you have resolved this problem, run "git am --continue".
    If you prefer to skip this patch, run "git am --skip" instead.
    To restore the original branch and stop patching, run "git am --abort".


> 
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index 0fa90fe..a34171e 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -195,6 +195,7 @@ TESTPROGS = adler32                                                     \
>              eval                                                        \
>              file                                                        \
>              fifo                                                        \
> +            fifo2                                                       \
>              float_dsp                                                   \
>              hash                                                        \
>              hmac                                                        \
> diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c
> index 923feee..e40b8cd 100644
> --- a/libavutil/tests/fifo2.c
> +++ b/libavutil/tests/fifo2.c

theres no libavutil/tests/fifo2.c in git master

[...]

Patch hide | download patch | download mbox

diff --git a/libavutil/Makefile b/libavutil/Makefile
index 0fa90fe..a34171e 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -195,6 +195,7 @@  TESTPROGS = adler32                                                     \
             eval                                                        \
             file                                                        \
             fifo                                                        \
+            fifo2                                                       \
             float_dsp                                                   \
             hash                                                        \
             hmac                                                        \
diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c
index 923feee..e40b8cd 100644
--- a/libavutil/tests/fifo2.c
+++ b/libavutil/tests/fifo2.c
@@ -35,7 +35,8 @@  int main(void)
 
     /*fill fifo buffer*/
 
-    if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != sizeof(elem)) {
+    if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != 
+        sizeof(elem)) {
 
         fprintf(stderr, "written incorrect number of bytes\n");
         return 1;
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 6fbad64..fdf9086 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -69,6 +69,10 @@  FATE_LIBAVUTIL += fate-fifo
 fate-fifo: libavutil/tests/fifo$(EXESUF)
 fate-fifo: CMD = run libavutil/tests/fifo
 
+FATE_LIBAVUTIL += fate-fifo2
+fate-fifo2: libavutil/tests/fifo2$(EXESUF)
+fate-fifo2: CMD = run libavutil/tests/fifo2
+
 FATE_LIBAVUTIL += fate-float-dsp
 fate-float-dsp: libavutil/tests/float_dsp$(EXESUF)
 fate-float-dsp: CMD = run libavutil/tests/float_dsp $(CPUFLAGS:%=-c%)
diff --git a/tests/ref/fate/fifo2 b/tests/ref/fate/fifo2
new file mode 100644
index 0000000..8df9243
--- /dev/null
+++ b/tests/ref/fate/fifo2
@@ -0,0 +1,3 @@ 
+fifo->buffer: 0, 2, 4, 6, 8, 10, 12, 
+space before av_fifo_grow	:0
+space after av_fifo_grow	:28