summaryrefslogtreecommitdiffstats
path: root/tests/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-19 00:49:20 +0000
committerTavian Barnes <tavianator@gmail.com>2009-10-19 00:49:20 +0000
commit19b06b1485a87a773d3f1ce897f6a00a22e6243d (patch)
tree66cddba24d8f59e1c58da0a7881cbc82e920d531 /tests/libdimension
parentfe51d90d38d14412a5f173b34e7ba5e0d8ddac80 (diff)
downloaddimension-19b06b1485a87a773d3f1ce897f6a00a22e6243d.tar.xz
Give the cube a black pigment in the default test scene.
Diffstat (limited to 'tests/libdimension')
-rw-r--r--tests/libdimension/tests.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/libdimension/tests.c b/tests/libdimension/tests.c
index 56a0368..12ff4e7 100644
--- a/tests/libdimension/tests.c
+++ b/tests/libdimension/tests.c
@@ -118,6 +118,31 @@ dmnsn_new_default_scene()
return NULL;
}
+ cube->texture = dmnsn_new_texture();
+ if (!cube->texture) {
+ dmnsn_delete_object(cube);
+ dmnsn_delete_pigment(sphere->texture->pigment);
+ dmnsn_delete_texture(sphere->texture);
+ dmnsn_delete_object(sphere);
+ dmnsn_delete_camera(scene->camera);
+ dmnsn_delete_canvas(scene->canvas);
+ dmnsn_delete_scene(scene);
+ return NULL;
+ }
+
+ cube->texture->pigment = dmnsn_new_solid_pigment(dmnsn_black);
+ if (!cube->texture->pigment) {
+ dmnsn_delete_texture(cube->texture);
+ dmnsn_delete_object(cube);
+ dmnsn_delete_pigment(sphere->texture->pigment);
+ dmnsn_delete_texture(sphere->texture);
+ dmnsn_delete_object(sphere);
+ dmnsn_delete_camera(scene->camera);
+ dmnsn_delete_canvas(scene->canvas);
+ dmnsn_delete_scene(scene);
+ return NULL;
+ }
+
cube->trans = dmnsn_matrix_inverse(
dmnsn_rotation_matrix(dmnsn_vector_construct(0.75, 0.0, 0.0))
);
@@ -133,7 +158,7 @@ dmnsn_delete_default_scene(dmnsn_scene *scene)
dmnsn_array_get(scene->objects, 0, &sphere);
dmnsn_array_get(scene->objects, 1, &cube);
-// dmnsn_delete_pigment(cube->texture->pigment);
+ dmnsn_delete_pigment(cube->texture->pigment);
dmnsn_delete_texture(cube->texture);
dmnsn_delete_object(cube);