summaryrefslogtreecommitdiffstats
path: root/libdimension/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-10-19 13:59:24 -0400
committerTavian Barnes <tavianator@gmail.com>2011-10-30 18:11:22 -0400
commit8e3a7158ecae541692826e7b5998c8ffc810173a (patch)
treebeda4f9f8604f77d0513d5fb02b7ddf53d203d09 /libdimension/tests
parente9810a7b1aae15320e58371b657a2f963562834d (diff)
downloaddimension-8e3a7158ecae541692826e7b5998c8ffc810173a.tar.xz
Make API more consistent.
Object methods should be dmnsn_<object>_<fn>().
Diffstat (limited to 'libdimension/tests')
-rw-r--r--libdimension/tests/polynomial.c8
-rw-r--r--libdimension/tests/render.c8
-rw-r--r--libdimension/tests/test_canvas.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/libdimension/tests/polynomial.c b/libdimension/tests/polynomial.c
index 5632b49..d66c975 100644
--- a/libdimension/tests/polynomial.c
+++ b/libdimension/tests/polynomial.c
@@ -40,7 +40,7 @@ main(void)
poly[1] = -646.270936;
poly[0] = 1447.8216;
- size_t n = dmnsn_solve_polynomial(poly, 5, x);
+ size_t n = dmnsn_polynomial_solve(poly, 5, x);
if (n != 4) {
fprintf(stderr,
"--- Wrong number of roots found (%zu, should be %u) ---\n",
@@ -49,9 +49,9 @@ main(void)
}
for (size_t i = 0; i < n; ++i) {
- double evmin = dmnsn_evaluate_polynomial(poly, 5, x[i] - dmnsn_epsilon);
- double ev = dmnsn_evaluate_polynomial(poly, 5, x[i]);
- double evmax = dmnsn_evaluate_polynomial(poly, 5, x[i] + dmnsn_epsilon);
+ double evmin = dmnsn_polynomial_evaluate(poly, 5, x[i] - dmnsn_epsilon);
+ double ev = dmnsn_polynomial_evaluate(poly, 5, x[i]);
+ double evmax = dmnsn_polynomial_evaluate(poly, 5, x[i] + dmnsn_epsilon);
if (fabs(evmin) < ev || fabs(evmax) < ev) {
fprintf(stderr, "--- Root %.15g is inaccurate! ---\n", x[i]);
return EXIT_FAILURE;
diff --git a/libdimension/tests/render.c b/libdimension/tests/render.c
index af22691..ae4a644 100644
--- a/libdimension/tests/render.c
+++ b/libdimension/tests/render.c
@@ -94,7 +94,7 @@ dmnsn_test_scene_add_background(dmnsn_scene *scene)
fprintf(stderr, "--- WARNING: Couldn't open or read png2.png! ---\n");
png_pigment = dmnsn_new_solid_pigment(dmnsn_orange);
}
- dmnsn_add_map_entry(sky_gradient_pigment_map, 0.0, &png_pigment);
+ dmnsn_map_add_entry(sky_gradient_pigment_map, 0.0, &png_pigment);
dmnsn_color background = dmnsn_color_from_sRGB(
dmnsn_new_color5(0.0, 0.1, 0.2, 0.1, 0.0)
@@ -269,7 +269,7 @@ dmnsn_test_scene_add_ground(dmnsn_scene *scene)
dmnsn_scale_matrix(dmnsn_new_vector(1.0/3.0, 1.0/3.0, 1.0/3.0));
dmnsn_map *big_map = dmnsn_new_pigment_map();
dmnsn_pigment_map_add_color(big_map, 0.0, dmnsn_white);
- dmnsn_add_map_entry(big_map, 1.0, &small_pigment);
+ dmnsn_map_add_entry(big_map, 1.0, &small_pigment);
plane->texture = dmnsn_new_texture();
plane->texture->pigment =
dmnsn_new_pigment_map_pigment(checker2, big_map, DMNSN_PIGMENT_MAP_REGULAR);
@@ -339,7 +339,7 @@ main(void)
}
}
- dmnsn_clear_canvas(scene->canvas, dmnsn_black);
+ dmnsn_canvas_clear(scene->canvas, dmnsn_black);
/* Create a new glX display */
dmnsn_display *display = NULL;
@@ -353,7 +353,7 @@ main(void)
/* Render the scene */
printf("Rendering scene\n");
- dmnsn_future *future = dmnsn_raytrace_scene_async(scene);
+ dmnsn_future *future = dmnsn_ray_trace_async(scene);
/* Display the scene as it's rendered */
if (display) {
diff --git a/libdimension/tests/test_canvas.c b/libdimension/tests/test_canvas.c
index b5d02ad..783914d 100644
--- a/libdimension/tests/test_canvas.c
+++ b/libdimension/tests/test_canvas.c
@@ -50,7 +50,7 @@ dmnsn_paint_test_canvas(dmnsn_canvas *canvas)
color = dmnsn_color_from_sRGB(color);
}
- dmnsn_set_pixel(canvas, x, y, color);
+ dmnsn_canvas_set_pixel(canvas, x, y, color);
}
}
}