[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Movi...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Movi... |
Date: |
Thu, 06 Mar 2008 13:07:33 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/03/06 13:07:33
Modified files:
. : ChangeLog
testsuite/actionscript.all: MovieClip.as
Log message:
add test for override of native properties (or getter/setters).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5818&r2=1.5819
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.116&r2=1.117
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5818
retrieving revision 1.5819
diff -u -b -r1.5818 -r1.5819
--- ChangeLog 6 Mar 2008 12:34:31 -0000 1.5818
+++ ChangeLog 6 Mar 2008 13:07:32 -0000 1.5819
@@ -1,3 +1,8 @@
+2008-03-06 Sandro Santilli <address@hidden>
+
+ * testsuite/actionscript.all/MovieClip.as: add test for override
+ of native properties (or getter/setters).
+
2008-03-06 Benjamin Wolsey <address@hidden>
* testsuite/actionscript.all/Global.as: add some checks that would
Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -b -r1.116 -r1.117
--- testsuite/actionscript.all/MovieClip.as 5 Mar 2008 03:56:05 -0000
1.116
+++ testsuite/actionscript.all/MovieClip.as 6 Mar 2008 13:07:33 -0000
1.117
@@ -20,6 +20,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
+rcsid="$Id: MovieClip.as,v 1.117 2008/03/06 13:07:33 strk Exp $";
#include "check.as"
@@ -31,15 +32,15 @@
#endif
#if OUTPUT_VERSION == 6
- check_totals(596); // SWF6
+ check_totals(611); // SWF6
#endif
#if OUTPUT_VERSION == 7
- check_totals(613); // SWF7
+ check_totals(628); // SWF7
#endif
#if OUTPUT_VERSION >= 8
- check_totals(614); // SWF8+
+ check_totals(629); // SWF8+
#endif
play();
@@ -1371,6 +1372,64 @@
check_equals(ret, 1);
//---------------------------------------------------------------------
+// Test native properties (getter-setter?)
+//---------------------------------------------------------------------
+
+#if OUTPUT_VERSION > 5 // addProperty needs SWF6
+
+//createEmptyMovieClip('mc', 10);
+mc = _root;
+mc._x = 20;
+check_equals(mc._x, 20);
+get = function() { /*note('get called');*/ getCalls++; return 17; };
+set = function() { /*note('set called');*/ setCalls++; };
+ret = mc.addProperty('_x', get, set);
+check_equals(ret, true);
+getCalls=0; setCalls=0;
+inspect = mc._x;
+check_equals(inspect, 17); // getMember invokes the getter
+check_equals(getCalls, 1);
+check_equals(setCalls, 0);
+mc.x = 10; // sets the property, but doesn't call the setter !
+check_equals(getCalls, 1); // assignment did call the getter
+check_equals(setCalls, 0);
+asm {
+ push 'propinspect'
+ push 'mc'
+ push 0
+ getproperty
+ setvariable
+};
+// setMember did set the prop, didn't call the setter
+xcheck_equals(propinspect, 20);
+
+createEmptyMovieClip('mc', 10);
+mc._x = 30;
+ret = mc.addProperty('_x', get, set);
+check_equals(ret, true);
+getCalls=0; setCalls=0;
+inspect = mc._x;
+check_equals(inspect, 17); // getMember invokes the getter
+check_equals(getCalls, 1);
+check_equals(setCalls, 0);
+mc.x = 10; // does NOT set the property, but doesn't call the setter !
+check_equals(getCalls, 1); // assignment did call the getter
+check_equals(setCalls, 0);
+asm {
+ push 'propinspect'
+ push 'mc'
+ push 0
+ getproperty
+ setvariable
+};
+// setMember did NOT set the prop, didn't call the setter
+check_equals(propinspect, 0);
+
+
+#endif // OUTPUT_VERSION > 5
+
+
+//---------------------------------------------------------------------
// Test the MovieClip.loadVariables function
//---------------------------------------------------------------------
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Movi...,
Sandro Santilli <=