[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Func...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Func... |
Date: |
Fri, 15 Dec 2006 09:02:49 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/15 09:02:49
Modified files:
. : ChangeLog
testsuite/actionscript.all: Function.as
Log message:
* testsuite/actionscript.all/Function.as: fixed for SWF5 target.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1942&r2=1.1943
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.19&r2=1.20
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1942
retrieving revision 1.1943
diff -u -b -r1.1942 -r1.1943
--- ChangeLog 15 Dec 2006 00:06:02 -0000 1.1942
+++ ChangeLog 15 Dec 2006 09:02:48 -0000 1.1943
@@ -1,5 +1,9 @@
2006-12-14 Sandro Santilli <address@hidden>
+ * testsuite/actionscript.all/Function.as: fixed for SWF5 target.
+
+2006-12-14 Sandro Santilli <address@hidden>
+
* server/as_environment.{cpp,h}: add dump_local_variables
method.
* server/vm/ActionExec.cpp: include dump of local variables
Index: testsuite/actionscript.all/Function.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- testsuite/actionscript.all/Function.as 14 Dec 2006 19:48:30 -0000
1.19
+++ testsuite/actionscript.all/Function.as 15 Dec 2006 09:02:49 -0000
1.20
@@ -20,7 +20,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Function.as,v 1.19 2006/12/14 19:48:30 strk Exp $";
+rcsid="$Id: Function.as,v 1.20 2006/12/15 09:02:49 strk Exp $";
#include "check.as"
@@ -28,15 +28,31 @@
// Define a function returning 'this'.name and the given args
function getThisName(a,b,c) { return this.name+a+b+c; }
-check (getThisName != undefined);
+#if OUTPUT_VERSION >=6
+ check (getThisName != undefined);
+#else
+ // this might be due to forced numerical comparison
+ xcheck_equals (getThisName, undefined);
+#endif
check_equals ( typeof(getThisName), "function" );
-// Test Function.apply(this_ref)
+//----------------------------------------------------------
+//
+// Test Function.apply
+//
+//----------------------------------------------------------
+
+#if OUTPUT_VERSION >= 6
+
+check_equals(typeof(getThisName.apply), 'function');
+
var this_ref = {name:"extname"};
+
+// Test Function.apply(this_ref, args_array)
#if OUTPUT_VERSION >= 7
-check_equals ( getThisName.apply(this_ref),
"extnameundefinedundefinedundefined" );
+ check_equals ( getThisName.apply(this_ref),
"extnameundefinedundefinedundefined" );
#else
-check_equals ( getThisName.apply(this_ref), "extname" );
+ check_equals ( getThisName.apply(this_ref), "extname" );
#endif
// Test Function.apply(this_ref, args_array)
@@ -44,47 +60,80 @@
check ( ret == "extname123" );
// Test invalid Function.apply calls
+
var ret=getThisName.apply();
#if OUTPUT_VERSION > 6
-xcheck ( isNaN(ret) ); // result of the *numerical* sum of all undefined
+ xcheck ( isNaN(ret) ); // result of the *numerical* sum of all undefined
#else
-check_equals ( ret , 0 ); // result of the *numerical* sum of all undefined
+ check_equals ( ret , 0 ); // result of the *numerical* sum of all undefined
#endif
+
var ret=getThisName.apply(this_ref, [4,5,6], 4);
check_equals ( ret , "extname456" );
var ret=getThisName.apply(this_ref, "8");
#if OUTPUT_VERSION >= 7
-check_equals ( ret , "extnameundefinedundefinedundefined" );
+ check_equals ( ret , "extnameundefinedundefinedundefined" );
#else
-check_equals ( ret , "extname" );
+ check_equals ( ret , "extname" );
#endif
+
var ret=getThisName.apply(this_ref, 9);
#if OUTPUT_VERSION >= 7
-check_equals ( ret , "extnameundefinedundefinedundefined" );
+ check_equals ( ret , "extnameundefinedundefinedundefined" );
#else
-check_equals ( ret , "extname" );
+ check_equals ( ret , "extname" );
#endif
+
var ret=getThisName.apply(undefined, [4,5,6], 4);
#if OUTPUT_VERSION >= 7
-xcheck ( isNaN(ret) ); // the sum will be considered numerical
+ xcheck ( isNaN(ret) ); // the sum will be considered numerical
#else
-check_equals ( ret , 15 ); // the sum will be considered numerical
+ check_equals ( ret , 15 ); // the sum will be considered numerical
#endif
+
var ret=getThisName.apply(undefined, 7);
#if OUTPUT_VERSION >= 7
-xcheck ( isNaN(ret) );
+ xcheck ( isNaN(ret) );
#else
-check_equals ( ret , 0 );
+ check_equals ( ret , 0 );
#endif
+
var ret=getThisName.apply(undefined, "7");
#if OUTPUT_VERSION >= 7
-xcheck ( isNaN(ret) );
+ xcheck ( isNaN(ret) );
#else
-check_equals ( ret , 0 );
+ check_equals ( ret , 0 );
+#endif
+
+#else // OUTPUT_VERSION < 6
+
+// No Function.apply... for SWF up to 5
+xcheck_equals(typeOf(getThisName.apply), 'undefined');
+
#endif
+//----------------------------------------------------------
+//
+// Test Function.call
+//
+//----------------------------------------------------------
+
+#if OUTPUT_VERSION >= 6
+
// Test Function.call(arg1, arg2, arg3)
-check ( getThisName.call(this_ref, 1, 2, 3) == "extname123" );
+check_equals ( getThisName.call(this_ref, 1, 2, 3), "extname123" );
+
+#else // OUTPUT_VERSION < 6
+
+xcheck_equals ( typeOf(getThisName.call), 'undefined' );
+
+#endif
+
+//----------------------------------------------------------
+//
+// Test Function definition
+//
+//----------------------------------------------------------
// Define a class with its constructor
var TestClass = function() {
@@ -92,17 +141,20 @@
};
// Test the Function constuctor
-check (TestClass != undefined);
-check ( typeof(TestClass) == "function" );
+check_equals ( typeOf(TestClass), 'function' );
-// test existance of the Function::apply method
-check (TestClass.apply != undefined);
+#if OUTPUT_VERSION >= 6
-// test existance of the Function::call method
-check (TestClass.call != undefined);
+ // Test existance of the Function::apply method
+ check_equals ( typeOf(TestClass.apply), 'function' );
+
+ // Test existance of the Function::call method
+ check_equals ( typeOf(TestClass.call), 'function' );
+
+#endif
// test existance of the Function::prototype member
-check (TestClass.prototype != undefined);
+check_equals ( typeOf(TestClass.prototype), 'object' );
// Define methods
TestClass.prototype.setname = function(name) {
@@ -123,7 +175,9 @@
// Test inheritance
check (testInstance.__proto__ != undefined);
check (testInstance.__proto__ == TestClass.prototype);
-check (TestClass.prototype.constructor != undefined);
+
+check_equals (typeOf(TestClass.prototype.constructor), 'function');
+
check (TestClass.prototype.constructor == TestClass);
check (testInstance.__proto__.constructor == TestClass);
@@ -136,7 +190,7 @@
var stringInstance = new String();
check (stringInstance.__proto__ != undefined);
check (stringInstance.__proto__ == String.prototype);
-check (String.prototype.constructor != undefined);
+check_equals ( typeof(String.prototype.constructor), 'function' );
check (String.prototype.constructor == String);
check (stringInstance.__proto__.constructor == String);