[FFmpeg-devel] [PATCH 2/2] checkasm: Simplify the list of tests using a macro

Henrik Gramner henrik at gramner.com
Thu Oct 1 19:50:19 CEST 2015


---
 tests/checkasm/checkasm.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 264473a..5626d2c 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -52,6 +52,8 @@
 #define isatty(fd) 1
 #endif
 
+#define ADD_TEST(name) { #name, checkasm_check_##name },
+
 /* List of tests to invoke */
 static const struct {
     const char *name;
@@ -59,25 +61,25 @@ static const struct {
 } tests[] = {
 #if CONFIG_AVCODEC
     #if CONFIG_BSWAPDSP
-        { "bswapdsp", checkasm_check_bswapdsp },
+        ADD_TEST(bswapdsp)
     #endif
     #if CONFIG_FLACDSP
-        { "flacdsp", checkasm_check_flacdsp },
+        ADD_TEST(flacdsp)
     #endif
     #if CONFIG_H264PRED
-        { "h264pred", checkasm_check_h264pred },
+        ADD_TEST(h264pred)
     #endif
     #if CONFIG_H264QPEL
-        { "h264qpel", checkasm_check_h264qpel },
+        ADD_TEST(h264qpel)
     #endif
     #if CONFIG_JPEG2000_DECODER
-        { "jpeg2000dsp", checkasm_check_jpeg2000dsp },
+        ADD_TEST(jpeg2000dsp)
     #endif
     #if CONFIG_V210_ENCODER
-        { "v210enc", checkasm_check_v210enc },
+        ADD_TEST(v210enc)
     #endif
     #if CONFIG_VP9_DECODER
-        { "vp9dsp", checkasm_check_vp9dsp },
+        ADD_TEST(vp9dsp)
     #endif
 #endif
     { NULL }
-- 
1.9.1



More information about the ffmpeg-devel mailing list