summaryrefslogtreecommitdiff
path: root/test/aliasing.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-03-16 16:48:18 +0100
committerAndrea Canciani <ranma42@gmail.com>2011-03-17 17:45:57 +0100
commit75fea162d985bea622afa59771fb2d07f5241d1b (patch)
tree5876692cd2ba574481210fae292eaf7f06005028 /test/aliasing.c
parent4ef32a36ba1e457e8dd6244a6483866d33477aac (diff)
downloadcairo-75fea162d985bea622afa59771fb2d07f5241d1b.tar.gz
test: Cleanup macros
The ARRAY_LENGTH macro is used by many tests, although sometimes it is named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it. In a similar way, MAX() and MIN() are currently defined in some specific tests, while they could be reused.
Diffstat (limited to 'test/aliasing.c')
-rw-r--r--test/aliasing.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/aliasing.c b/test/aliasing.c
index 78a6d0310..73c1f1ae2 100644
--- a/test/aliasing.c
+++ b/test/aliasing.c
@@ -46,10 +46,8 @@ static const struct color {
{ 1, 0, 1 },
{ .5, .5, .5 },
};
-#define NUM_COLORS (sizeof (color) / sizeof (color[0]))
-#ifndef MAX
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
+
+#define NUM_COLORS ARRAY_LENGTH (color)
static void
object (cairo_t *cr, const struct color *fg, const struct color *bg)