added tests passing infinity to various functions

felipesanches-svg
Brad Pitcher 2012-01-08 11:40:04 -08:00
parent f3e6e8168b
commit 28f5f7a910
3 changed files with 48 additions and 1 deletions

23
testdata/scad/misc/inf-tests.scad vendored Normal file
View File

@ -0,0 +1,23 @@
echo(1/0);
echo(-1/0);
echo(sin(1/0));
echo(cos(1/0));
echo(tan(1/0));
echo(asin(1/0));
echo(acos(1/0));
echo(atan(1/0));
echo(atan(-1/0));
echo(atan2(1/0, -1/0));
echo(ceil(1/0));
echo(floor(1/0));
echo(exp(2, 1/0));
echo(ln(1/0));
echo(log(1/0));
echo(max(-1/0, 1/0));
echo(min(-1/0, 1/0));
echo(pow(2, 1/0));
echo(round(1/0));
echo(sign(1/0));
echo(sign(-1/0));
echo(sqrt(1/0));
echo(sqrt(-1/0));

View File

@ -599,7 +599,8 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/builtin-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/dim-all.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-indexing.scad)
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-indexing.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/inf-tests.scad)
list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} ${FEATURES_FILES} ${EXAMPLE_FILES})
list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad)

View File

@ -0,0 +1,23 @@
ECHO: inf
ECHO: -inf
ECHO: -nan
ECHO: -nan
ECHO: -nan
ECHO: nan
ECHO: nan
ECHO: 90.0000000000000
ECHO: -90.000000000000
ECHO: 135.000000000000
ECHO: inf
ECHO: inf
ECHO: undef
ECHO: inf
ECHO: inf
ECHO: inf
ECHO: -inf
ECHO: inf
ECHO: inf
ECHO: 1.00000000000000
ECHO: -1.0000000000000
ECHO: inf
ECHO: -nan