gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Math.as


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Math.as
Date: Tue, 04 Mar 2008 11:21:10 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/03/04 11:21:10

Modified files:
        .              : ChangeLog 
        testsuite/actionscript.all: Math.as 

Log message:
        test Math.round('')

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5796&r2=1.5797
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Math.as?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5796
retrieving revision 1.5797
diff -u -b -r1.5796 -r1.5797
--- ChangeLog   4 Mar 2008 11:04:34 -0000       1.5796
+++ ChangeLog   4 Mar 2008 11:21:08 -0000       1.5797
@@ -1,5 +1,6 @@
 2008-03-04 Sandro Santilli <address@hidden>
 
+       * testsuite/actionscript.all/Math.as: test Math.round('').
        * server/sprite_instance.cpp: check arguments of drawing api
          functions for being finite.
        * testsuite/misc-ming.all/DrawingApiTest.as: test passing

Index: testsuite/actionscript.all/Math.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Math.as,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- testsuite/actionscript.all/Math.as  31 Jan 2008 15:23:41 -0000      1.8
+++ testsuite/actionscript.all/Math.as  4 Mar 2008 11:21:10 -0000       1.9
@@ -17,7 +17,7 @@
 //
 
 
-rcsid="$Id: Math.as,v 1.8 2008/01/31 15:23:41 bwy Exp $";
+rcsid="$Id: Math.as,v 1.9 2008/03/04 11:21:10 strk Exp $";
 
 // Test case for Math ActionScript class
 //
@@ -123,9 +123,9 @@
 var delta = new Number(0.000000000000001);
 
 
-//
-// Single-argument functions
-//
+//-----------------------------------------------------------------
+// Test Math.abs
+//-----------------------------------------------------------------
 
 check_equals (Math.abs(15), 15);
 check_equals (Math.abs(-15), 15);
@@ -140,6 +140,10 @@
 #endif
 check_equals (Math.abs().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.acos
+//-----------------------------------------------------------------
+
 check_equals (Math.acos(0).toString(), pi_2s);
 check_equals (Math.acos(1), 0);
 check_equals (Math.acos(0.5).toString(), "1.0471975511966");
@@ -165,6 +169,10 @@
 check_equals (Math.acos(notanumber).toString(), "NaN");
 check_equals (Math.acos().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.asin
+//-----------------------------------------------------------------
+
 check_equals (Math.asin(0), 0);
 check_equals (Math.asin(1).toString(), pi_2s);
 check_equals (Math.asin(-1).toString(), "-" + pi_2s);
@@ -182,6 +190,10 @@
 #endif
 check_equals (Math.asin().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.atan
+//-----------------------------------------------------------------
+
 check_equals (Math.atan(0), 0);
 check_equals (Math.atan(0.5).toString(), "0.463647609000806");
 check_equals (Math.atan(-0.5).toString(), "-0.463647609000806");
@@ -199,6 +211,10 @@
 #endif
 check_equals (Math.atan().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.ceil
+//-----------------------------------------------------------------
+
 check_equals (Math.ceil(0), 0);
 check_equals (Math.ceil(1), 1);
 check_equals (Math.ceil(-1), -1);
@@ -218,6 +234,10 @@
 #endif
 check_equals (Math.ceil().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.cos
+//-----------------------------------------------------------------
+
 check_equals (Math.cos(0), 1);
 // Flash gives 6.12303176911189e-17 so check that our answer is within similar
 // accuracy. Testing shows that actually we give exactly the same result.
@@ -239,6 +259,10 @@
 #endif
 check_equals (Math.cos().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.exp
+//-----------------------------------------------------------------
+
 check_equals (Math.exp(0), 1);
 check_equals (Math.exp(1).toString(), "2.71828182845905");
 check_equals (Math.exp(2).toString(), "7.38905609893065");
@@ -253,6 +277,10 @@
 #endif
 check_equals (Math.exp().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.floor
+//-----------------------------------------------------------------
+
 check_equals (Math.floor(0), 0);
 check_equals (Math.floor(0.1), 0);
 check_equals (Math.floor(0.5), 0);
@@ -272,6 +300,10 @@
 #endif
 check_equals (Math.floor().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.log
+//-----------------------------------------------------------------
+
 check_equals (Math.log(0).toString(), "-Infinity");
 check_equals (Math.log(1), 0);
 check_equals (Math.log(Math.E), 1);
@@ -287,12 +319,20 @@
 #endif
 check_equals (Math.log().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.random
+//-----------------------------------------------------------------
+
 var math_random = new Number(Math.random());
 check (math_random >= 0.0 && math_random < 1.0)
 var math_random2 = new Number(Math.random());
 check (math_random2 >= 0.0 && math_random2 < 1.0)
 check (math_random != math_random2);           // very unlikely, anyhow!
 
+//-----------------------------------------------------------------
+// Test Math.round
+//-----------------------------------------------------------------
+
 check_equals (Math.round(0), 0);
 check_equals (Math.round(0.1), 0);
 check_equals (Math.round(0.49), 0);
@@ -305,6 +345,8 @@
 check_equals (Math.round(plusinf).toString(), "Infinity");
 check_equals (Math.round(minusinf).toString(), "-Infinity");
 check_equals (Math.round(notanumber).toString(), "NaN");
+check(isNaN(Math.round('')));
+check_equals(typeof(Math.round('')), 'number');
 #if OUTPUT_VERSION < 7
  check_equals (Math.round(undefined).toString(), "0"); 
 #else
@@ -314,6 +356,10 @@
 // Don't know what round() and friends do with huge numbers that cannot be
 // resolved to individual integer resolution. Don't really care either...
 
+//-----------------------------------------------------------------
+// Test Math.sin
+//-----------------------------------------------------------------
+
 check_equals (Math.sin(0), 0);
 check_equals (Math.sin(Math.PI / 2), 1);
 //check_equals (Math.sin(-Math.PI / 2), -1);
@@ -336,6 +382,10 @@
 #endif
 check_equals (Math.sin().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.sqrt
+//-----------------------------------------------------------------
+
 check_equals (Math.sqrt(0), 0);
 check_equals (Math.sqrt(1), 1);
 check_equals (Math.sqrt(-1).toString(), "NaN");
@@ -352,6 +402,10 @@
 #endif
 check_equals (Math.sqrt().toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.tan
+//-----------------------------------------------------------------
+
 check_equals (Math.tan(0), 0);
 // Should either be very large or very small, according to inaccuracy of PI
 check (Math.tan(Math.PI / 2) > 1/delta || Math.tan(Math.PI / 2) < -1/delta);
@@ -372,9 +426,9 @@
 #endif
 check_equals (Math.tan().toString(), "NaN");
 
-//
-// Two-argument functions
-//
+//-----------------------------------------------------------------
+// Test Math.atan2
+//-----------------------------------------------------------------
 
 check_equals (Math.atan2().toString(), "NaN");
 check_equals (Math.atan2(1).toString(), "NaN");
@@ -407,6 +461,10 @@
  check_equals (Math.atan2(1,undefined).toString(), "NaN"); 
 #endif
 
+//-----------------------------------------------------------------
+// Test Math.max
+//-----------------------------------------------------------------
+
 xcheck_equals (Math.max().toString(), "-Infinity");  // Heaven knows why!
 check_equals (Math.max(1).toString(), "NaN");
 check_equals (Math.max(1,2), 2);
@@ -424,6 +482,10 @@
 #endif
 check_equals (Math.max(0,notanumber).toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.min
+//-----------------------------------------------------------------
+
 xcheck_equals (Math.min().toString(), "Infinity");  // Heaven knows why!
 check_equals (Math.min(1).toString(), "NaN");
 check_equals (Math.min(1,2), 1);
@@ -442,6 +504,10 @@
 #endif
 check_equals (Math.min(0,notanumber).toString(), "NaN");
 
+//-----------------------------------------------------------------
+// Test Math.pow
+//-----------------------------------------------------------------
+
 check_equals (Math.pow().toString(), "NaN");
 check_equals (Math.pow(0).toString(), "NaN");
 xcheck_equals (Math.pow(1), 1);                        // !!
@@ -468,9 +534,13 @@
 check_equals (Math.pow(-2, 0.5).toString(), "NaN");
 check_equals (Math.pow(-2, -0.5).toString(), "NaN");
 
+//-----------------------------------------------------------------
+// END OF TESTS
+//-----------------------------------------------------------------
+
 // End of Math testsuite
 #if OUTPUT_VERSION <= 6
- check_totals(269);
+ check_totals(271);
 #else
- check_totals(278);
+ check_totals(280);
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]