Add test case for more complicated recursive function calls.

recursion-fix
Torsten Paul 2014-03-22 18:44:41 +01:00
parent 7531280809
commit 5b29023e6b
8 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,12 @@
function f() = f() + f();
function g() = g(g());
module m(x) {
cube(x);
}
echo(f());
m(g());
translate([20, 20, 0]) m(10);

View File

@ -805,6 +805,7 @@ file(GLOB EXAMPLE_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad)
list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/features/for-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/function-recursion-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/echo-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/parser-tests.scad

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,7 @@
group() {
multmatrix([[1, 0, 0, 20], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) {
group() {
cube(size = [10, 10, 10], center = false);
}
}
}

View File

@ -0,0 +1,4 @@
ERROR: Recursion detected calling function 'f'
ERROR: Function recursion caught while instantiating module 'echo'
ERROR: Recursion detected calling function 'g'
ERROR: Function recursion caught while instantiating module 'm'

View File

@ -1,2 +1,2 @@
ERROR: Recursion detected calling function 'crash'
ECHO: undef
ERROR: Function recursion caught while instantiating module 'echo'

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB