[cairo-commit] test/random-intersections-curves-eo.c test/random-intersections-curves-nz.c
M. Joonas Pihlaja
joonas at kemper.freedesktop.org
Thu Sep 3 11:56:09 PDT 2009
test/random-intersections-curves-eo.c | 17 ++++++++++-------
test/random-intersections-curves-nz.c | 17 ++++++++++-------
2 files changed, 20 insertions(+), 14 deletions(-)
New commits:
commit 316c1683ceb39eb652608adc360cb4da9c22256a
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Thu Sep 3 21:38:31 2009 +0300
[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.
diff --git a/test/random-intersections-curves-eo.c b/test/random-intersections-curves-eo.c
index 3fa12b2..84e9a75 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 0109817..5265e4a 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);
More information about the cairo-commit
mailing list