star-line

Structure for accelerating line importance sampling
git clone git://git.meso-star.fr/star-line.git
Log | Files | Refs | README | LICENSE

commit 93bc30c7734727aed47697edc65903ca1f16c1f3
parent e0669f09d99f5866e16b662a05f13310fff6b0db
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 30 Apr 2026 12:26:49 +0200

Taking tree-building tests a step further

Add a test for building a tree sequentially. By default, the tree is
built in parallel.

Diffstat:
Msrc/test_sln_tree.c | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/test_sln_tree.c b/src/test_sln_tree.c @@ -415,6 +415,14 @@ test_tree CHK(sln_tree_create(sln, &tree_args, &tree) == RES_BAD_ARG); tree_args.leaf_nlines = SLN_TREE_CREATE_ARGS_DEFAULT.leaf_nlines; + tree_args.nthreads_hint = 0; + CHK(sln_tree_create(sln, &tree_args, &tree) == RES_BAD_ARG); + tree_args.nthreads_hint = 1; + + /* Check that, as expected, the tree is created correctly using the arguments + * defined so far. This will confirm that the creation failures tested so far + * are indeed due to arguments explicitly defined as incorrect, and not to + * invalid arguments introduced by mistake */ CHK(sln_tree_create(sln, &tree_args, &tree) == RES_OK); if(tree_args.arity == 2 && tree_args.collapse_polylines == 0) { @@ -566,6 +574,13 @@ main(int argc, char** argv) test_tree(sln, &tree_args, line_list); test_tree_serialization(sln, &tree_args); + /* Test a tree with a non default arity built sequentially*/ + tree_args.arity = 13; + tree_args.nthreads_hint = 1; + test_tree(sln, &tree_args, line_list); + test_tree_serialization(sln, &tree_args); + tree_args.nthreads_hint = SLN_TREE_CREATE_ARGS_DEFAULT.nthreads_hint; + /* Test a tree with a non-standard arity, where the polylines of the internal * nodes are created by collapsing the polylines of their child nodes */ tree_args.arity = 5;