summaryrefslogtreecommitdiffstats
path: root/libdimension/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/tests')
-rw-r--r--libdimension/tests/future.c6
-rw-r--r--libdimension/tests/polynomial.c2
-rw-r--r--libdimension/tests/pool.c6
-rw-r--r--libdimension/tests/prtree.c24
-rw-r--r--libdimension/tests/render.c2
5 files changed, 20 insertions, 20 deletions
diff --git a/libdimension/tests/future.c b/libdimension/tests/future.c
index ee2511a..a223a44 100644
--- a/libdimension/tests/future.c
+++ b/libdimension/tests/future.c
@@ -22,9 +22,9 @@
* Tests for dmnsn_future.
*/
-#include "../platform.c"
-#include "../future.c"
-#include "../threads.c"
+#include "../platform/platform.c"
+#include "../concurrency/future.c"
+#include "../concurrency/threads.c"
#include "tests.h"
#include <stdatomic.h>
diff --git a/libdimension/tests/polynomial.c b/libdimension/tests/polynomial.c
index 492c22c..a983bd4 100644
--- a/libdimension/tests/polynomial.c
+++ b/libdimension/tests/polynomial.c
@@ -22,8 +22,8 @@
* Basic tests of the polynomial root-finder.
*/
+#include "../math/polynomial.c"
#include "tests.h"
-#include "../polynomial.c"
#include <stdarg.h>
#define DMNSN_CLOSE_ENOUGH 1.0e-6
diff --git a/libdimension/tests/pool.c b/libdimension/tests/pool.c
index 1722d66..6090c36 100644
--- a/libdimension/tests/pool.c
+++ b/libdimension/tests/pool.c
@@ -22,10 +22,10 @@
* Tests for memory pools.
*/
-#include "../dimension-internal.h"
+#include "../concurrency/future.c"
+#include "../concurrency/threads.c"
+#include "../internal.h"
#include "tests.h"
-#include "../future.c"
-#include "../threads.c"
static dmnsn_pool *pool;
diff --git a/libdimension/tests/prtree.c b/libdimension/tests/prtree.c
index acdd426..8824e93 100644
--- a/libdimension/tests/prtree.c
+++ b/libdimension/tests/prtree.c
@@ -22,28 +22,28 @@
* Basic tests of PR-trees.
*/
-#include "../platform.c"
-#include "../threads.c"
-#include "../future.c"
-#include "../bvh.c"
-#include "../prtree.c"
+#include "../platform/platform.c"
+#include "../concurrency/threads.c"
+#include "../concurrency/future.c"
+#include "../bvh/bvh.c"
+#include "../bvh/prtree.c"
#include <stdio.h>
#include <stdlib.h>
unsigned int calls = 0;
static bool
-dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_line line,
+dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_ray ray,
dmnsn_intersection *intersection)
{
- intersection->t = (object->bounding_box.min.z - line.x0.z)/line.n.z;
+ intersection->t = (object->aabb.min.z - ray.x0.z)/ray.n.z;
intersection->normal = dmnsn_x;
++calls;
return true;
}
static void
-dmnsn_randomize_bounding_box(dmnsn_object *object)
+dmnsn_randomize_aabb(dmnsn_object *object)
{
dmnsn_vector a, b;
@@ -55,8 +55,8 @@ dmnsn_randomize_bounding_box(dmnsn_object *object)
b.y = 2.0*((double)rand())/RAND_MAX - 1.0;
b.z = 2.0*((double)rand())/RAND_MAX - 1.0;
- object->bounding_box.min = dmnsn_vector_min(a, b);
- object->bounding_box.max = dmnsn_vector_max(a, b);
+ object->aabb.min = dmnsn_vector_min(a, b);
+ object->aabb.max = dmnsn_vector_max(a, b);
}
static const dmnsn_object_vtable dmnsn_fake_vtable = {
@@ -67,7 +67,7 @@ static dmnsn_object *
dmnsn_new_fake_object(dmnsn_pool *pool)
{
dmnsn_object *object = dmnsn_new_object(pool);
- dmnsn_randomize_bounding_box(object);
+ dmnsn_randomize_aabb(object);
object->vtable = &dmnsn_fake_vtable;
object->trans_inv = dmnsn_identity_matrix();
return object;
@@ -92,7 +92,7 @@ main(void)
dmnsn_bvh *bvh = dmnsn_new_bvh(objects, DMNSN_BVH_PRTREE);
dmnsn_intersection intersection;
- dmnsn_line ray = dmnsn_new_line(
+ dmnsn_ray ray = dmnsn_new_ray(
dmnsn_new_vector(0.0, 0.0, -2.0),
dmnsn_new_vector(0.0, 0.0, 1.0)
);
diff --git a/libdimension/tests/render.c b/libdimension/tests/render.c
index 56a80d3..fd1e96d 100644
--- a/libdimension/tests/render.c
+++ b/libdimension/tests/render.c
@@ -350,7 +350,7 @@ main(void)
// Render the scene
printf("Rendering scene\n");
- dmnsn_future *future = dmnsn_ray_trace_async(scene);
+ dmnsn_future *future = dmnsn_render_async(scene);
// Display the scene as it's rendered
if (display) {