Merge branch 'master' into unstable

Conflicts:
	tests/regression/throwntogethertest/difference-tests-expected.png
customizer
Marius Kintel 2014-01-24 18:18:20 -05:00
commit 33ab1fd9e4
5 changed files with 105 additions and 1 deletions

View File

@ -39,6 +39,10 @@
/*Unicode support for string lengths and array accesses*/
#include <glib.h>
#include <boost/math/special_functions/fpclassify.hpp>
using boost::math::isnan;
using boost::math::isinf;
std::ostream &operator<<(std::ostream &stream, const Filename &filename)
{
fs::path fnpath = fs::path( (std::string)filename );
@ -642,7 +646,11 @@ void Value::RangeType::normalize() {
}
uint32_t Value::RangeType::nbsteps() const {
if (begin_val == end_val) {
if (isnan(step_val) || isinf(begin_val) || (isinf(end_val))) {
return std::numeric_limits<uint32_t>::max();
}
if ((begin_val == end_val) || isinf(step_val)) {
return 0;
}

View File

@ -39,3 +39,39 @@ for(r=[1:true:5]) translate([r*10-60,50,0]) cylinder(r=r);
// Vector
for(r=[1,2,5]) translate([r*10-30,0,0]) cylinder(r=r);
nan = 0/0;
inf = 1/0;
ninf = -1/0;
echo(nan);
echo(inf);
echo(ninf);
// validate step values
for(i=[0:nan:0]) { echo("NAN", i); }
for(i=[0:inf:0]) { echo("INF", i); }
for(i=[0:ninf:0]) { echo("-INF", i); }
for(i=[0:nan:1]) { echo("NAN", i); }
for(i=[0:inf:1]) { echo("INF", i); }
for(i=[0:ninf:1]) { echo("-INF", i); }
for(i=[1:nan:0]) { echo("NAN", i); }
for(i=[1:inf:0]) { echo("INF", i); }
for(i=[1:ninf:0]) { echo("-INF", i); }
// validate begin / end values
for(i = [0:inf]) {}
for(i = [0:ninf]) {}
for(i = [inf:0]) {}
for(i = [ninf:0]) {}
for(i = [0:2:inf]) {}
for(i = [0:2:ninf]) {}
for(i = [inf:2:0]) {}
for(i = [ninf:2:0]) {}
for(i = [inf:2:inf]) {}
for(i = [ninf:2:ninf]) {}
for(i = [inf:2:ninf]) {}
for(i = [ninf:2:inf]) {}

View File

@ -806,6 +806,7 @@ file(GLOB FUNCTION_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/functions/*.scad)
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/misc/echo-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/parser-tests.scad

View File

@ -128,4 +128,36 @@ group() {
cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false);
}
}
group();
group();
group();
group();
group() {
group();
}
group() {
group();
}
group();
group() {
group();
}
group();
group();
group();
group() {
group();
}
group();
group();
group();
group();
group();
group();
group();
group();
group();
group();
group();
group();
}

View File

@ -0,0 +1,27 @@
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
WARNING: Bad range parameter in for statement: too many elements (4294967295).
ECHO: nan
ECHO: inf
ECHO: -inf
WARNING: Bad range parameter in for statement: too many elements (4294967295).
ECHO: "INF", 0
ECHO: "-INF", 0
WARNING: Bad range parameter in for statement: too many elements (4294967295).
ECHO: "INF", 0
WARNING: Bad range parameter in for statement: too many elements (4294967295).
ECHO: "-INF", 1
WARNING: Bad range parameter in for statement: too many elements (4294967295).
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
WARNING: Bad range parameter in for statement: too many elements (4294967295).
DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).
WARNING: Bad range parameter in for statement: too many elements (4294967295).