summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-11-15 20:34:42 (GMT)
committerMarius Kintel <marius@kintel.net>2013-11-15 20:34:42 (GMT)
commit022f80e87b1df5af489414a01bf2b5bcef1c3acd (patch)
treed20c8d9df56f129880df6426c0f885479ebc014a /tests
parentaf8359993a6dfffed8f57bc5605f2ca77a353ffa (diff)
parentf46bd3788f75e691b65aaf0e4ffb1db1029ef717 (diff)
Merge pull request #542 from t-paul/issue500
Allow for statement with negative step value.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/regression/cgalpngtest/for-tests-expected.pngbin10995 -> 7124 bytes
-rw-r--r--tests/regression/dumptest/for-tests-expected.csg18
-rw-r--r--tests/regression/echotest/children-tests-expected.echo1
-rw-r--r--tests/regression/echotest/range-tests-expected.echo81
-rw-r--r--tests/regression/moduledumptest/allexpressions-expected.ast2
-rw-r--r--tests/regression/opencsgtest/for-tests-expected.pngbin11584 -> 7416 bytes
-rw-r--r--tests/regression/throwntogethertest/for-tests-expected.pngbin6927 -> 7533 bytes
8 files changed, 101 insertions, 4 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 0e5981f..6aff17b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -804,7 +804,8 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/lookup-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/expression-shortcircuit-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/parent_module-tests.scad
- ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/children-tests.scad)
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/children-tests.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/range-tests.scad)
list(APPEND DUMPTEST_FILES ${FEATURES_FILES} ${EXAMPLE_FILES})
list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad
diff --git a/tests/regression/cgalpngtest/for-tests-expected.png b/tests/regression/cgalpngtest/for-tests-expected.png
index bf1970a..65db59f 100644
--- a/tests/regression/cgalpngtest/for-tests-expected.png
+++ b/tests/regression/cgalpngtest/for-tests-expected.png
Binary files differ
diff --git a/tests/regression/dumptest/for-tests-expected.csg b/tests/regression/dumptest/for-tests-expected.csg
index 7aa29d7..b61d9cd 100644
--- a/tests/regression/dumptest/for-tests-expected.csg
+++ b/tests/regression/dumptest/for-tests-expected.csg
@@ -80,7 +80,23 @@ group() {
cube(size = [1, 9.2, 2], center = true);
}
}
- group();
+ group() {
+ multmatrix([[1, 0, 0, 20], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false);
+ }
+ multmatrix([[1, 0, 0, 10], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 4, r2 = 4, center = false);
+ }
+ multmatrix([[1, 0, 0, 0], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 3, r2 = 3, center = false);
+ }
+ multmatrix([[1, 0, 0, -10], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 2, r2 = 2, center = false);
+ }
+ multmatrix([[1, 0, 0, -20], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 1, r2 = 1, center = false);
+ }
+ }
group() {
multmatrix([[1, 0, 0, -20], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 1, r2 = 1, center = false);
diff --git a/tests/regression/echotest/children-tests-expected.echo b/tests/regression/echotest/children-tests-expected.echo
index 7b8278a..cdd2eb1 100644
--- a/tests/regression/echotest/children-tests-expected.echo
+++ b/tests/regression/echotest/children-tests-expected.echo
@@ -31,5 +31,4 @@ ECHO: "child3"
ECHO: "child1"
ECHO: "child3"
ECHO: "child5"
-WARNING: Bad range parameter for children: too many elements (-4).
ECHO: "Children range: end"
diff --git a/tests/regression/echotest/range-tests-expected.echo b/tests/regression/echotest/range-tests-expected.echo
new file mode 100644
index 0000000..ddff38e
--- /dev/null
+++ b/tests/regression/echotest/range-tests-expected.echo
@@ -0,0 +1,81 @@
+ECHO: "[a01] ----- [1:4]"
+ECHO: "[a01] ", 1
+ECHO: "[a01] ", 2
+ECHO: "[a01] ", 3
+ECHO: "[a01] ", 4
+ECHO: "[a02] ----- [4:1]"
+DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
+ECHO: "[a02] ", 1
+ECHO: "[a02] ", 2
+ECHO: "[a02] ", 3
+ECHO: "[a02] ", 4
+ECHO: "[a03] ----- [0:0]"
+ECHO: "[a03] ", 0
+ECHO: "[a04] ----- [0:3]"
+ECHO: "[a04] ", 0
+ECHO: "[a04] ", 1
+ECHO: "[a04] ", 2
+ECHO: "[a04] ", 3
+ECHO: "[a05] ----- [-3:0]"
+ECHO: "[a05] ", -3
+ECHO: "[a05] ", -2
+ECHO: "[a05] ", -1
+ECHO: "[a05] ", 0
+ECHO: "[a06] ----- [0:-3]"
+DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
+ECHO: "[a06] ", -3
+ECHO: "[a06] ", -2
+ECHO: "[a06] ", -1
+ECHO: "[a06] ", 0
+ECHO: "[a07] ----- [-2:2]"
+ECHO: "[a07] ", -2
+ECHO: "[a07] ", -1
+ECHO: "[a07] ", 0
+ECHO: "[a07] ", 1
+ECHO: "[a07] ", 2
+ECHO: "[a08] ----- [2:-2]"
+DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
+ECHO: "[a08] ", -2
+ECHO: "[a08] ", -1
+ECHO: "[a08] ", 0
+ECHO: "[a08] ", 1
+ECHO: "[a08] ", 2
+ECHO: "[b01] ----- [1:1:5]"
+ECHO: "[b01] ", 1
+ECHO: "[b01] ", 2
+ECHO: "[b01] ", 3
+ECHO: "[b01] ", 4
+ECHO: "[b01] ", 5
+ECHO: "[b02] ----- [1:2:5]"
+ECHO: "[b02] ", 1
+ECHO: "[b02] ", 3
+ECHO: "[b02] ", 5
+ECHO: "[b03] ----- [1:-1:5]"
+ECHO: "[b04] ----- [5:1:1]"
+ECHO: "[b05] ----- [5:2:1]"
+ECHO: "[b06] ----- [5:-1:1]"
+ECHO: "[b06] ", 5
+ECHO: "[b06] ", 4
+ECHO: "[b06] ", 3
+ECHO: "[b06] ", 2
+ECHO: "[b06] ", 1
+ECHO: "[b07] ----- [0:0:0]"
+ECHO: "[b08] ----- [1:0:1]"
+ECHO: "[b09] ----- [1:0:5]"
+WARNING: Bad range parameter in for statement: too many elements (4294967295).
+ECHO: "[b10] ----- [0:1:0]"
+ECHO: "[b10] ", 0
+ECHO: "[b11] ----- [3:-.5:-3]"
+ECHO: "[b11] ", 3
+ECHO: "[b11] ", 2.5
+ECHO: "[b11] ", 2
+ECHO: "[b11] ", 1.5
+ECHO: "[b11] ", 1
+ECHO: "[b11] ", 0.5
+ECHO: "[b11] ", 0
+ECHO: "[b11] ", -0.5
+ECHO: "[b11] ", -1
+ECHO: "[b11] ", -1.5
+ECHO: "[b11] ", -2
+ECHO: "[b11] ", -2.5
+ECHO: "[b11] ", -3
diff --git a/tests/regression/moduledumptest/allexpressions-expected.ast b/tests/regression/moduledumptest/allexpressions-expected.ast
index 6d9de40..69ec746 100644
--- a/tests/regression/moduledumptest/allexpressions-expected.ast
+++ b/tests/regression/moduledumptest/allexpressions-expected.ast
@@ -6,7 +6,7 @@ e = $fn;
f1 = [1];
f2 = [1, 2, 3];
g = ((f2.x + f2.y) + f2.z);
-h1 = [2 : 1 : 5];
+h1 = [2 : 5];
h2 = [1 : 2 : 10];
i = ((h2.begin - h2.step) - h2.end);
j = "test";
diff --git a/tests/regression/opencsgtest/for-tests-expected.png b/tests/regression/opencsgtest/for-tests-expected.png
index 968659d..5218b8b 100644
--- a/tests/regression/opencsgtest/for-tests-expected.png
+++ b/tests/regression/opencsgtest/for-tests-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/for-tests-expected.png b/tests/regression/throwntogethertest/for-tests-expected.png
index 6641555..7b58005 100644
--- a/tests/regression/throwntogethertest/for-tests-expected.png
+++ b/tests/regression/throwntogethertest/for-tests-expected.png
Binary files differ
contact: Jan Huwald // Impressum