gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9793: Tests.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9793: Tests.
Date: Fri, 19 Sep 2008 17:39:55 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9793
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2008-09-19 17:39:55 +0200
message:
  Tests.
added:
  testsuite/actionscript.all/Transform.as
modified:
  testsuite/actionscript.all/Makefile.am
  testsuite/actionscript.all/MovieClip.as
    ------------------------------------------------------------
    revno: 9788.2.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-09-19 14:36:38 +0200
    message:
      Couple more tests.
    modified:
      testsuite/actionscript.all/MovieClip.as
    ------------------------------------------------------------
    revno: 9788.2.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-09-19 17:29:35 +0200
    message:
      Test flash.geom.Transform.
    added:
      testsuite/actionscript.all/Transform.as
    modified:
      testsuite/actionscript.all/Makefile.am
=== modified file 'testsuite/actionscript.all/Makefile.am'
--- a/testsuite/actionscript.all/Makefile.am    2008-07-24 16:06:11 +0000
+++ b/testsuite/actionscript.all/Makefile.am    2008-09-19 15:29:35 +0000
@@ -110,6 +110,7 @@
        TextField.as            \
        TextFormat.as           \
        TextSnapshot.as         \
+       Transform.as            \
        Try.as \
        Video.as                \
        Matrix.as \

=== modified file 'testsuite/actionscript.all/MovieClip.as'
--- a/testsuite/actionscript.all/MovieClip.as   2008-09-19 14:56:17 +0000
+++ b/testsuite/actionscript.all/MovieClip.as   2008-09-19 15:39:55 +0000
@@ -1397,6 +1397,20 @@
 _root._x = _root._y = _root._rotation = 0;
 _root._xscale = _root._yscale = 100;
 
+OldTransform = flash.geom.Transform;
+
+flash.geom.Transform = 1;
+check_equals(_root.transform.toString(), undefined);
+check_equals(_root.transform.matrix.toString(), undefined);
+
+flash.geom.Transform = OldTransform;
+flash.geom.Transform.matrix = 3;
+check_equals(_root.transform.matrix.toString(), "(a=1, b=0, c=0, d=1, tx=0, 
ty=0)");
+
+flash.geom.Transform = OldTransform;
+check_equals(_root.transform.toString(), "[object Object]");
+
+
 #endif
 
 //----------------------------------------------

=== added file 'testsuite/actionscript.all/Transform.as'
--- a/testsuite/actionscript.all/Transform.as   1970-01-01 00:00:00 +0000
+++ b/testsuite/actionscript.all/Transform.as   2008-09-19 15:29:35 +0000
@@ -0,0 +1,89 @@
+//
+//   Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+//
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// Test case for Transform ActionScript class
+// compile this test case with Ming makeswf, and then
+// execute it like this gnash -1 -r 0 -v out.swf
+
+rcsid="$Id: Transform.as,v 1.3 2008/06/20 13:28:56 bwy Exp $";
+
+#include "check.as"
+
+#if OUTPUT_VERSION < 8
+check_equals(flash.geom.Transform, undefined);
+totals(1);
+#else
+
+Transform = flash.geom.Transform;
+Matrix = flash.geom.Matrix;
+ColorTransform = flash.geom.ColorTransform;
+Rectangle = flash.geom.Rectangle;
+
+check(Transform.prototype.hasOwnProperty("matrix"));
+check(Transform.prototype.hasOwnProperty("concatenatedMatrix"));
+check(Transform.prototype.hasOwnProperty("colorTransform"));
+check(Transform.prototype.hasOwnProperty("concatenatedColorTransform"));
+check(Transform.prototype.hasOwnProperty("pixelBounds"));
+
+// Cannot be instantiated.
+t = new Transform;
+xcheck_equals(t, undefined);
+
+t = Transform();
+xcheck_equals(t, undefined);
+
+// Only (?) obtainable from MovieClip.transform?
+t = _root.transform;
+xcheck_equals(typeOf(t), "object");
+
+xcheck(t.matrix instanceOf Matrix);
+xcheck(t.concatenatedMatrix instanceOf Matrix);
+xcheck(t.colorTransform instanceOf ColorTransform);
+xcheck(t.concatenatedColorTransform instanceOf ColorTransform);
+xcheck(t.pixelBounds instanceOf Rectangle);
+
+xcheck_equals(t.matrix.toString(), "(a=1, b=0, c=0, d=1, tx=0, ty=0)");
+xcheck_equals(t.colorTransform.toString(), "(redMultiplier=1, 
greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, 
greenOffset=0, blueOffset=0, alphaOffset=0)");
+xcheck_equals(t.concatenatedColorTransform.toString(), "(redMultiplier=1, 
greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, 
greenOffset=0, blueOffset=0, alphaOffset=0)");
+// These vary slightly with the pp
+//check_equals(t.concatenatedMatrix.toString(), "(a=1, b=0, c=0, d=1, tx=0, 
ty=0)");
+//check_equals(t.pixelBounds.toString(), "(x=-2, y=48, w=804, h=804)");
+
+
+// Tricks with the flash package:
+flash.geom.Matrix = undefined;
+check_equals(t.matrix, undefined);
+xcheck_equals(t.colorTransform.toString(), "(redMultiplier=1, 
greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, 
greenOffset=0, blueOffset=0, alphaOffset=0)");
+flash.geom.ColorTransform = undefined;
+check_equals(t.colorTransform, undefined);
+xcheck(t.pixelBounds instanceOf Rectangle);
+flash.geom.Rectangle = undefined;
+check_equals(t.pixelBounds, undefined);
+
+
+flash.geom.Matrix = Matrix;
+xcheck_equals(t.matrix.toString(), "(a=1, b=0, c=0, d=1, tx=0, ty=0)");
+check_equals(t.colorTransform, undefined);
+flash.geom.ColorTransform = ColorTransform;
+xcheck_equals(t.colorTransform.toString(), "(redMultiplier=1, 
greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, 
greenOffset=0, blueOffset=0, alphaOffset=0)");
+flash.geom.Rectangle = Rectangle;
+xcheck(t.pixelBounds instanceOf Rectangle);
+
+
+totals(25);
+#endif


reply via email to

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