commit d1097a96bead3bca7012af41a7655130dbd60fe2
parent 4646b3cbae34571324c6ad39180f75117cb45b3d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 13 Sep 2018 16:27:27 +0200
Add basic tests on arguments validity in test_svx_octree_trace_ray
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/test_svx_octree_trace_ray.c b/src/test_svx_octree_trace_ray.c
@@ -348,6 +348,13 @@ main(int argc, char** argv)
d3(r.org, -5,-5, 0);
d3(r.dir, 0, 1, 0);
d2(r.range, 0, INF);
+
+ CHK(RT(NULL, r.org, r.dir, r.range, NULL, NULL, NULL, &hit) == RES_BAD_ARG);
+ CHK(RT(oct, NULL, r.dir, r.range, NULL, NULL, NULL, &hit) == RES_BAD_ARG);
+ CHK(RT(oct, r.org, NULL, r.range, NULL, NULL, NULL, &hit) == RES_BAD_ARG);
+ CHK(RT(oct, r.org, r.dir, NULL, NULL, NULL, NULL, &hit) == RES_BAD_ARG);
+ CHK(RT(oct, r.org, r.dir, r.range, NULL, NULL, NULL, NULL) == RES_BAD_ARG);
+
CHK(RT(oct, r.org, r.dir, r.range, NULL, NULL, NULL, &hit) == RES_OK);
CHK(SVX_HIT_NONE(&hit));
@@ -376,7 +383,7 @@ main(int argc, char** argv)
CHK(hit.voxel.is_leaf);
CHK(*(char*)hit.voxel.data == 1);
- /* Use th ray range to avoid the intersection with the closest voxel */
+ /* Use the ray range to avoid the intersection with the closest voxel */
r.range[1] = nextafter(hit.distance[0], -1);
CHK(RT(oct, r.org, r.dir, r.range, NULL, hit_filter, &r, &hit) == RES_OK);
CHK(SVX_HIT_NONE(&hit));