Added child-tests

stl_dim
Marius Kintel 2011-09-08 08:21:53 +02:00
parent 4d1cf0d0a0
commit 5ce3d4ff8d
4 changed files with 36 additions and 1 deletions

34
testdata/scad/features/child-tests.scad vendored Normal file
View File

@ -0,0 +1,34 @@
$fn=16;
module parent() {
for (i=[0:2]) {
translate([2.5*i,0,0]) child(i);
}
}
// Normal
parent() {
sphere();
cylinder(h=2, center=true);
cube(2, center=true);
}
// No children
parent();
// Too few children
translate([0,3,0]) parent() { sphere(); }
// No parameter to child
module parent2() {
child();
}
translate([2.5,3,0]) parent2() { cylinder(h=2, center=true); sphere(); }
// Negative parameter to child
module parent3() {
child(-1);
}
translate([5,3,0]) parent3() { cube(); sphere(); }

View File

@ -234,7 +234,8 @@ LIST(APPEND CGALPNGTEST_FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/features/render-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/projection-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/assign-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/include-tests.scad)
${CMAKE_SOURCE_DIR}/../testdata/scad/features/include-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-tests.scad)
#LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example001.scad)
add_cmdline_test(cgalpngtest png ${CGALPNGTEST_FILES})

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB