summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2014-11-14 18:10:16 -0800
committerBryce Harrington <bryce@osg.samsung.com>2014-11-20 12:22:06 -0800
commit7edc5a8844b96862b866901568eb83fa56f4755b (patch)
tree61eda7ee6d679b260c54fab84ff1d15621a1971c
parentae608035c7b7133826a608d45e067c3875a1aceb (diff)
test: Use ARRAY_LENGTH macro
-rw-r--r--test/bug-spline.c3
-rw-r--r--test/caps-tails-curve.c2
-rw-r--r--test/tiger.c2
3 files changed, 3 insertions, 4 deletions
diff --git a/test/bug-spline.c b/test/bug-spline.c
index 00a915cd3..9a54a7c8c 100644
--- a/test/bug-spline.c
+++ b/test/bug-spline.c
@@ -56,7 +56,6 @@ static const struct spline {
{ 1, 0, 0, 1 },
}
};
-#define NUM_SPLINES (sizeof(splines)/sizeof(splines[0]))
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
@@ -68,7 +67,7 @@ draw (cairo_t *cr, int width, int height)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
- for (n = 0; n < NUM_SPLINES; n++) {
+ for (n = 0; n < ARRAY_LENGTH(splines); n++) {
cairo_set_line_width (cr, splines[n].line_width);
cairo_set_source_rgba (cr,
splines[n].rgba[0],
diff --git a/test/caps-tails-curve.c b/test/caps-tails-curve.c
index 25e58199a..fa6aded3d 100644
--- a/test/caps-tails-curve.c
+++ b/test/caps-tails-curve.c
@@ -100,7 +100,7 @@ draw (cairo_t *cr, int width, int height)
cairo_set_line_width (cr, LINE_WIDTH);
- for (t = 0; t < sizeof(theta)/sizeof (theta[0]); t++) {
+ for (t = 0; t < ARRAY_LENGTH(theta); t++) {
cairo_save (cr);
cairo_translate (cr, 0, t * (SIZE + PAD) + PAD);
draw_caps_joins (cr, theta[t]);
diff --git a/test/tiger.c b/test/tiger.c
index 6f45f1f03..059bb849f 100644
--- a/test/tiger.c
+++ b/test/tiger.c
@@ -37,7 +37,7 @@ draw (cairo_t *cr, int width, int height)
cairo_translate (cr, width/2, height/2);
cairo_scale (cr, .85, .85);
- for (i = 0; i < sizeof (tiger_commands)/sizeof(tiger_commands[0]);i++) {
+ for (i = 0; i < ARRAY_LENGTH(tiger_commands); i++) {
const struct command *cmd = &tiger_commands[i];
switch (cmd->type) {
case 'm':