gnash-commit
[Top][All Lists]
Advanced

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

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


From: Zou Lunkai
Subject: [Gnash-commit] gnash/testsuite/actionscript.all Color.as
Date: Tue, 20 May 2008 01:59:28 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  08/05/20 01:59:28

Modified files:
        testsuite/actionscript.all: Color.as 

Log message:
        add test for cxform accuracy, pp uses 1/256 accuracy.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Color.as?cvsroot=gnash&r1=1.15&r2=1.16

Patches:
Index: Color.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Color.as,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- Color.as    17 Apr 2008 10:22:23 -0000      1.15
+++ Color.as    20 May 2008 01:59:28 -0000      1.16
@@ -22,7 +22,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: Color.as,v 1.15 2008/04/17 10:22:23 bwy Exp $";
+rcsid="$Id: Color.as,v 1.16 2008/05/20 01:59:28 zoulunkai Exp $";
 #include "check.as"
 
 //--------------------------------
@@ -218,7 +218,8 @@
 check_equals ( trans2.rb, 0 );
 check_equals ( trans2.ga, -50 );
 check_equals ( trans2.gb, 255 );
-xcheck_equals ( Math.round(trans2.ba*100)/100, 31.64 ); // gnash returns 32, 
who's right ?
+// pp uses 1/256 accuracy, 31.640625 == int(0.32*256)*100/256.0f
+xcheck( trans2.ba - 31.640625 < 0.000001 ); // Don't use check_equals or 
Math.round here.
 check_equals ( trans2.bb, 2 );
 check_equals ( trans2.aa, 100 );
 check_equals ( trans2.ab, 0 );
@@ -240,8 +241,20 @@
 check_equals ( trans.aa, 100 );
 check_equals ( trans.ab, 0 );
 
-// Some tests for same-named (case-insensitive) variables in SWF6
+//
+// Accuracy test
+//
+trans.ra = 99.9;
+trans.rb = 99.9;
+colorObj.setTransform(trans);
+trans2 = colorObj.getTransform();
+// 99.609375 == int(0.999*256)*100/256.0
+xcheck(trans2.ra - 99.609375 < 0.0000001); // Don't use check_equals or 
Math.round here.
+check_equals(trans2.rb, 99);
 
+//
+// Some tests for same-named (case-insensitive) variables in SWF6
+//
 #if OUTPUT_VERSION == 6
 color = 8;
 




reply via email to

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