diff mbox

[FFmpeg-devel] avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS

Message ID 1481050802-87807-1-git-send-email-wtc@google.com
State Accepted, archived
Headers show

Commit Message

Wan-Teh Chang Dec. 6, 2016, 7 p.m. UTC
Also declare the main() function with void arguments because argc and
argv are unused.

These changes are suggested by Diego Biurrun and James Almer.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
---
 libavutil/Makefile         | 2 +-
 libavutil/tests/cpu_init.c | 9 +--------
 tests/fate/libavutil.mak   | 2 +-
 3 files changed, 3 insertions(+), 10 deletions(-)

Comments

Carl Eugen Hoyos Dec. 10, 2016, 1:58 p.m. UTC | #1
2016-12-06 20:00 GMT+01:00 Wan-Teh Chang <wtc-at-google.com@ffmpeg.org>:
> Also declare the main() function with void arguments because argc and
> argv are unused.

Sounds like an unrelated change that should be part of an independent patch.

Carl Eugen
James Almer Dec. 10, 2016, 9:49 p.m. UTC | #2
On 12/6/2016 4:00 PM, Wan-Teh Chang wrote:
> Also declare the main() function with void arguments because argc and
> argv are unused.
> 
> These changes are suggested by Diego Biurrun and James Almer.
> 
> Signed-off-by: Wan-Teh Chang <wtc@google.com>
> ---
>  libavutil/Makefile         | 2 +-
>  libavutil/tests/cpu_init.c | 9 +--------
>  tests/fate/libavutil.mak   | 2 +-
>  3 files changed, 3 insertions(+), 10 deletions(-)

Split and pushed, thanks.
diff mbox

Patch

diff --git a/libavutil/Makefile b/libavutil/Makefile
index c61ca9c..607fe6a 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -188,7 +188,6 @@  TESTPROGS = adler32                                                     \
             camellia                                                    \
             color_utils                                                 \
             cpu                                                         \
-            cpu_init                                                    \
             crc                                                         \
             des                                                         \
             dict                                                        \
@@ -223,6 +222,7 @@  TESTPROGS = adler32                                                     \
             tea                                                         \
 
 TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
+TESTPROGS-$(HAVE_THREADS) += cpu_init
 
 TOOLS = crypto_bench ffhash ffeval ffescape
 
diff --git a/libavutil/tests/cpu_init.c b/libavutil/tests/cpu_init.c
index 5a5ecda..a379e47 100644
--- a/libavutil/tests/cpu_init.c
+++ b/libavutil/tests/cpu_init.c
@@ -24,12 +24,9 @@ 
 #include <stdio.h>
 #include <string.h>
 
-#include "config.h"
-
 #include "libavutil/cpu.h"
 #include "libavutil/thread.h"
 
-#if HAVE_PTHREADS
 static void *thread_main(void *arg)
 {
     int *flags = arg;
@@ -37,12 +34,9 @@  static void *thread_main(void *arg)
     *flags = av_get_cpu_flags();
     return NULL;
 }
-#endif
-
 
-int main(int argc, char **argv)
+int main(void)
 {
-#if HAVE_PTHREADS
     int cpu_flags1;
     int cpu_flags2;
     int ret;
@@ -66,7 +60,6 @@  int main(int argc, char **argv)
         return 2;
     if (cpu_flags1 != cpu_flags2)
         return 3;
-#endif
 
     return 0;
 }
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 0ab6fc5..4ecc741 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -44,7 +44,7 @@  fate-cpu: libavutil/tests/cpu$(EXESUF)
 fate-cpu: CMD = runecho libavutil/tests/cpu $(CPUFLAGS:%=-c%) $(THREADS:%=-t%)
 fate-cpu: REF = /dev/null
 
-FATE_LIBAVUTIL += fate-cpu_init
+FATE_LIBAVUTIL-$(HAVE_THREADS) += fate-cpu_init
 fate-cpu_init: libavutil/tests/cpu_init$(EXESUF)
 fate-cpu_init: CMD = run libavutil/tests/cpu_init
 fate-cpu_init: REF = /dev/null