From e541df8bb50df403afded7dfe73d9df5b542d2e4 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 29 Jan 2012 19:02:19 +0100 Subject: [PATCH] Added test case for recently fixed csg normalization bugfix --- doc/TODO.txt | 2 -- testdata/scad/bugs/intersection-prune-test.scad | 9 +++++++++ tests/CMakeLists.txt | 1 + .../intersection-prune-test-expected.png | Bin 0 -> 4408 bytes .../intersection-prune-test-expected.png | Bin 0 -> 4408 bytes 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 testdata/scad/bugs/intersection-prune-test.scad create mode 100644 tests/regression/opencsgtest/intersection-prune-test-expected.png create mode 100644 tests/regression/throwntogethertest/intersection-prune-test-expected.png diff --git a/doc/TODO.txt b/doc/TODO.txt index 2b19a12a..e7e0105c 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -254,8 +254,6 @@ o Caching - Test that caching is actually performed (speedup + same results) - Test the modifier characters correctly influence the cache (also when added/removed) -o CSG normalization - - Empty top-level intersection o other tests - export - cmd-line tests diff --git a/testdata/scad/bugs/intersection-prune-test.scad b/testdata/scad/bugs/intersection-prune-test.scad new file mode 100644 index 00000000..3c6df7aa --- /dev/null +++ b/testdata/scad/bugs/intersection-prune-test.scad @@ -0,0 +1,9 @@ +// This tree cannot be pruned inline, but will still result in an empty CSG tree +// Crashes OpenSCAD-2011.12. Bug fixed in 14e4f3bb +intersection() { + union() { + cube(); + translate([4,0,0]) cube(); + } + translate([2,0,0]) cube(); +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 931fb123..665bd92f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -619,6 +619,7 @@ list(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include- ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad) list(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) list(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/bbox-transform-bug.scad) +list(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/intersection-prune-test.scad) list(APPEND THROWNTOGETHERTEST_FILES ${OPENCSGTEST_FILES}) list(APPEND CGALSTLSANITYTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/normal-nan.scad) diff --git a/tests/regression/opencsgtest/intersection-prune-test-expected.png b/tests/regression/opencsgtest/intersection-prune-test-expected.png new file mode 100644 index 0000000000000000000000000000000000000000..50d838c32f7b9119a1e8638f0bdf495d7e6931e2 GIT binary patch literal 4408 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&t&wwUqN(1_puuo-U3d6^w7MGV(Gg@Gv_b z*dOfDv*2+)UsdcS+v4fU4h;;A^A5apoi>Akk%?tr1LFsF77l?9E{TSWk4eG`4hI;1 z0L3|6Sa}?_RBYrFP)K0-15&w&iA^DD&kdkj1BSW=phzGivw&_~4p6NGgFVR96%C9X zV)|x4wLA^-3JwhpAqN;-y2WP$)v_Jn7f^6e&`MxfbhO(SsGIo#JBNURfT#h(#Yacg z92$VmU>Akk%?tr1LFsF77l?9E{TSWk4eG`4hI;1 z0L3|6Sa}?_RBYrFP)K0-15&w&iA^DD&kdkj1BSW=phzGivw&_~4p6NGgFVR96%C9X zV)|x4wLA^-3JwhpAqN;-y2WP$)v_Jn7f^6e&`MxfbhO(SsGIo#JBNURfT#h(#Yacg z92$VmU>