summaryrefslogtreecommitdiffstats
path: root/tests/tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests.c')
-rw-r--r--tests/tests.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/tests.c b/tests/tests.c
index 218fcfd..ed00b64 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -82,6 +82,25 @@ dmnsn_new_default_scene()
return NULL;
}
+ sphere->texture = dmnsn_new_texture();
+ if (!sphere->texture) {
+ dmnsn_delete_object(sphere);
+ dmnsn_delete_camera(scene->camera);
+ dmnsn_delete_canvas(scene->canvas);
+ dmnsn_delete_scene(scene);
+ return NULL;
+ }
+
+ sphere->texture->pigment = dmnsn_new_solid_pigment(dmnsn_white);
+ if (!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;
+ }
+
sphere->trans = dmnsn_matrix_inverse(
dmnsn_scale_matrix(dmnsn_vector_construct(1.25, 1.25, 1.25))
);
@@ -89,6 +108,8 @@ dmnsn_new_default_scene()
cube = dmnsn_new_cube();
if (!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);
@@ -101,8 +122,6 @@ dmnsn_new_default_scene()
);
dmnsn_array_push(scene->objects, &cube);
- scene->quality = DMNSN_RENDER_FULL;
-
return scene;
}
@@ -113,8 +132,14 @@ 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_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);