From 1662c94348eda19ec35db2625749febd1dceb35e Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Thu, 3 Nov 2011 10:53:10 +0100 Subject: [PATCH] test: Reuse the ARRAY_LENGTH() macro It is provided by utils.h, there is no need to redefine it. --- test/alphamap.c | 2 -- test/scaling-crash-test.c | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/alphamap.c b/test/alphamap.c index 554b309..24a350e 100644 --- a/test/alphamap.c +++ b/test/alphamap.c @@ -139,8 +139,6 @@ get_alpha (pixman_image_t *image, int x, int y, int orig_x, int orig_y) return r; } -#define ARRAY_LENGTH(A) ((int) (sizeof (A) / sizeof ((A) [0]))) - static int run_test (int s, int d, int sa, int da, int soff, int doff) { diff --git a/test/scaling-crash-test.c b/test/scaling-crash-test.c index 50d445d..ed57ae0 100644 --- a/test/scaling-crash-test.c +++ b/test/scaling-crash-test.c @@ -130,12 +130,11 @@ do_test (int32_t dst_size, int32_t src_offs, int32_t scale_factor) { -#define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0])) int i, j; - for (i = 0; i < N_ELEMENTS(filters); ++i) + for (i = 0; i < ARRAY_LENGTH (filters); ++i) { - for (j = 0; j < N_ELEMENTS (repeats); ++j) + for (j = 0; j < ARRAY_LENGTH (repeats); ++j) { /* horizontal test */ if (run_test (dst_size, 1, -- 2.7.4