summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-03 21:38:31 +0300
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-03 21:38:31 +0300
commit316c1683ceb39eb652608adc360cb4da9c22256a (patch)
tree715cd0a324bbc3cc0b753d5354a4870b36996277
parent9e45673e197d0f43e296483cc6b5ca6df94e7f02 (diff)
[test] Fix the order of random points random-intersections-curves*.
The calls to uniform_random() to get the curve points were in the function arguments, but argument order evaluation is compiler implementation dependent.
-rw-r--r--test/random-intersections-curves-eo.c17
-rw-r--r--test/random-intersections-curves-nz.c17
2 files changed, 20 insertions, 14 deletions
diff --git a/test/random-intersections-curves-eo.c b/test/random-intersections-curves-eo.c
index 3fa12b2b..84e9a75d 100644
--- a/test/random-intersections-curves-eo.c
+++ b/test/random-intersections-curves-eo.c
@@ -54,13 +54,16 @@ draw (cairo_t *cr, int width, int height)
cairo_move_to (cr, 0, 0);
for (i = 0; i < NUM_SEGMENTS; i++) {
- cairo_curve_to (cr,
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (0, SIZE),
- uniform_random (0, SIZE));
+ double y3 = uniform_random (0, SIZE);
+ double x3 = uniform_random (0, SIZE);
+ double y2 = uniform_random (-SIZE, SIZE);
+ double x2 = uniform_random (-SIZE, SIZE);
+ double y1 = uniform_random (-SIZE, SIZE);
+ double x1 = uniform_random (-SIZE, SIZE);
+ cairo_curve_to (cr,
+ x1, y1,
+ x2, y2,
+ x3, y3);
}
cairo_close_path (cr);
diff --git a/test/random-intersections-curves-nz.c b/test/random-intersections-curves-nz.c
index 01098177..5265e4a7 100644
--- a/test/random-intersections-curves-nz.c
+++ b/test/random-intersections-curves-nz.c
@@ -54,13 +54,16 @@ draw (cairo_t *cr, int width, int height)
cairo_move_to (cr, 0, 0);
for (i = 0; i < NUM_SEGMENTS; i++) {
- cairo_curve_to (cr,
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (-SIZE, SIZE),
- uniform_random (0, SIZE),
- uniform_random (0, SIZE));
+ double y3 = uniform_random (0, SIZE);
+ double x3 = uniform_random (0, SIZE);
+ double y2 = uniform_random (-SIZE, SIZE);
+ double x2 = uniform_random (-SIZE, SIZE);
+ double y1 = uniform_random (-SIZE, SIZE);
+ double x1 = uniform_random (-SIZE, SIZE);
+ cairo_curve_to (cr,
+ x1, y1,
+ x2, y2,
+ x3, y3);
}
cairo_close_path (cr);