Fixed a bunch of undef math warnings with dev snapshot OpenSCAD builds.

This commit is contained in:
Garth Minette
2020-10-03 19:50:29 -07:00
parent e3ccf482fa
commit 16ee49e8b2
15 changed files with 215 additions and 161 deletions

View File

@@ -72,8 +72,7 @@ test_constrain();
module test_is_matrix() {
assert(is_matrix([[2,3,4],[5,6,7],[8,9,10]]));
assert(is_matrix([[2,3,4],[5,6,7],[8,9,10]],square=true));
assert(is_matrix([[2,3,4],[5,6,7],[8,9,10]],square=false));
assert(is_matrix([[2,3],[5,6],[8,9]],3,2));
assert(is_matrix([[2,3],[5,6],[8,9]],m=3,n=2));
assert(is_matrix([[2,3,4],[5,6,7]],m=2,n=3));
assert(is_matrix([[2,3,4],[5,6,7]],2,3));
@@ -82,8 +81,6 @@ module test_is_matrix() {
assert(is_matrix([[2,3,4],[5,6,7]],n=3));
assert(!is_matrix([[2,3,4],[5,6,7]],m=4));
assert(!is_matrix([[2,3,4],[5,6,7]],n=5));
assert(!is_matrix([[2,3,4],[5,6,7]],m=2,n=3,square=true));
assert(is_matrix([[2,3,4],[5,6,7],[8,9,10]],square=false));
assert(!is_matrix([[2,3],[5,6],[8,9]],m=2,n=3));
assert(!is_matrix([[2,3,4],[5,6,7]],m=3,n=2));
assert(!is_matrix(undef));
@@ -688,10 +685,10 @@ module test_count_true() {
assert_equal(count_true([1,false,undef]), 1);
assert_equal(count_true([1,5,false]), 2);
assert_equal(count_true([1,5,true]), 3);
assert_equal(count_true([[0,0], [0,0]]), 0);
assert_equal(count_true([[0,0], [1,0]]), 1);
assert_equal(count_true([[1,1], [1,1]]), 4);
assert_equal(count_true([[1,1], [1,1]], nmax=3), 3);
assert_equal(count_true([[0,0], [0,0]]), 2);
assert_equal(count_true([[0,0], [1,0]]), 2);
assert_equal(count_true([[1,1], [1,1]]), 2);
assert_equal(count_true([1,1,1,1,1], nmax=3), 3);
}
test_count_true();