[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ./ChangeLog testsuite/actionscript.all/Fu...
From: |
strk |
Subject: |
[Gnash-commit] gnash ./ChangeLog testsuite/actionscript.all/Fu... |
Date: |
Thu, 09 Feb 2006 00:37:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: strk <address@hidden> 06/02/09 00:37:25
Modified files:
. : ChangeLog
testsuite/actionscript.all: Function.as Global.as Makefile.am
Object.as
Added files:
testsuite/actionscript.all: check.as
Log message:
Added dejagnu testing framework (a 'check' macro)
Changed Object,Function and Global tests to use the new macro.
Added generated files to all: rule.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.106&tr2=1.107&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/Function.as.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/Global.as.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/Makefile.am.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/Object.as.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/testsuite/actionscript.all/check.as?rev=1.1
Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.106 gnash/ChangeLog:1.107
--- gnash/ChangeLog:1.106 Wed Feb 8 21:39:24 2006
+++ gnash/ChangeLog Thu Feb 9 00:37:25 2006
@@ -1,6 +1,9 @@
2006-02-08 Sandro Santilli <address@hidden>
* testsuite/actionscript.all/Global.as: _global functions tests
+ * testsuite/actionscript.all/Function.as: modified to use check.as
+ * testsuite/actionscript.all/Object.as: modified to use check.as
+ * testsuite/actionscript.all/check.as: framework for dejagnu testing
2006-02-08 Michael Carlson <address@hidden>
Index: gnash/testsuite/actionscript.all/Function.as
diff -u gnash/testsuite/actionscript.all/Function.as:1.5
gnash/testsuite/actionscript.all/Function.as:1.6
--- gnash/testsuite/actionscript.all/Function.as:1.5 Tue Feb 7 03:12:26 2006
+++ gnash/testsuite/actionscript.all/Function.as Thu Feb 9 00:37:25 2006
@@ -21,41 +21,20 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-// Define USE_XTRACE to use "visual" trace
-#ifdef USE_XTRACE
-# include "xtrace.as"
-# define trace xtrace
-#endif
+#include "check.as"
// Define a function returning 'this'.name and the given args
function getThisName(a,b,c) { return this.name+a+b+c; }
-if (getThisName != undefined)
-{
- if ( typeof(getThisName) == "function" ) {
- trace("PASSED: Function constructor");
- } else {
- trace("FAILED: Function constructor (is a
"+typeof(TestClass)+", not a function)");
- }
-} else {
- trace("FAILED: Function constructor");
-}
+check (getThisName != undefined);
+check ( typeof(getThisName) == "function" );
// Test Function.apply(this_ref)
var this_ref = {name:"extname"};
-if ( getThisName.apply(this_ref) == "extname" ) {
- trace("PASSED: Function.apply(this_ref)");
-} else {
- trace("FAILED: Function.apply(this_ref)");
-}
+check ( getThisName.apply(this_ref) == "extname" );
// Test Function.apply(this_ref, args_array)
var ret=getThisName.apply(this_ref, [1,2,3]);
-if ( ret == "extname123" ) {
- trace("PASSED: Function.apply(this_ref, args_array)");
-} else {
- trace("FAILED: Function.apply(this_ref, args_array) returned "+ret);
-}
-
+check ( ret == "extname123" );
// Define a class with its constructor
var TestClass = function() {
@@ -63,36 +42,17 @@
};
// Test the Function constuctor
-if (TestClass != undefined) {
- if ( typeof(TestClass) == "function" ) {
- trace("PASSED: Function constructor");
- } else {
- trace("FAILED: Function constructor (is a
"+typeof(TestClass)+", not a function)");
- }
-} else {
- trace("FAILED: Function constructor");
-}
+check (TestClass != undefined);
+check ( typeof(TestClass) == "function" );
// test existance of the Function::apply method
-if (TestClass.apply != undefined) {
- trace("PASSED: Function::apply() is defined");
-} else {
- trace("FAILED: Function::apply() is undefined");
-}
+check (TestClass.apply != undefined);
// test existance of the Function::call method
-if (TestClass.call != undefined) {
- trace("PASSED: Function::call() is defined");
-} else {
- trace("FAILED: Function::call() is undefined");
-}
+check (TestClass.call != undefined);
// test existance of the Function::prototype member
-if (TestClass.prototype != undefined) {
- trace("PASSED: Function.prototype is defined");
-} else {
- trace("FAILED: Function.prototype is undefined");
-}
+check (TestClass.prototype != undefined);
// Define methods
TestClass.prototype.setname = function(name) {
@@ -101,39 +61,15 @@
// Test instanciation of Function
var testInstance = new TestClass;
-if (testInstance != undefined) {
- trace("PASSED: Function instance is defined");
-} else {
- trace("FAILED: Function instance is undefined");
-}
-if (testInstance.name != undefined) {
- trace("PASSED: Function instance member is defined");
-} else {
- trace("FAILED: Function instance member is undefined");
-}
-if (testInstance.name == "NONE") {
- trace("PASSED: Function instance member is initialized");
-} else {
- trace("FAILED: Function instance member is not initialized (class ctor
failed)");
-}
-if (typeof(testInstance.setname) == "function") {
- trace("PASSED: Function instance method is function");
-} else {
- trace("FAILED: Function instance method is
"+typeof(testInstance.setname));
-}
+check (testInstance != undefined);
+check (testInstance.name != undefined);
+check (testInstance.name == "NONE");
+check (typeof(testInstance.setname) == "function");
// Test methods call
testInstance.setname("Test");
-if (testInstance.name == "Test") {
- trace("PASSED: Function instance method works");
-} else {
- trace("FAILED: Function instance method doesn't work");
-}
+check (testInstance.name == "Test");
// Test the instanceof operator
-if ( testInstance instanceof TestClass ) {
- trace("PASSED: testInstance instance of TestClass");
-} else {
- trace("FAILED: testInstance not instance of TestClass");
-}
+check ( testInstance instanceof TestClass );
Index: gnash/testsuite/actionscript.all/Global.as
diff -u gnash/testsuite/actionscript.all/Global.as:1.2
gnash/testsuite/actionscript.all/Global.as:1.3
--- gnash/testsuite/actionscript.all/Global.as:1.2 Wed Feb 8 22:57:48 2006
+++ gnash/testsuite/actionscript.all/Global.as Thu Feb 9 00:37:25 2006
@@ -21,65 +21,21 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-// Define USE_XTRACE to use "visual" trace
-#ifdef USE_XTRACE
-# include "xtrace.as"
-# define trace xtrace
-#endif
-
+#include "check.as"
// Check that _global.parseInt is in effect what parseInt resolves to
-if ( parseInt == _global.parseInt ) {
- trace("PASSED: parseInt == _global.parseInt");
-} else {
- trace("FAILED: parseInt != _global.parseInt");
-}
+check ( parseInt == _global.parseInt );
// Test parseInt
-var a = parseInt('45b');
-if ( a == 45 ) {
- trace("PASSED: parseInt('45b')");
-} else {
- trace("FAILED: parseInt('45b') == "+a);
-}
-a = parseInt('65');
-if ( a == 65 ) {
- trace("PASSED: parseInt('65')");
-} else {
- trace("FAILED: parseInt('65') == "+a);
-}
-a = parseInt('-1234');
-if ( a == -1234 ) {
- trace("PASSED: parseInt('-1234')");
-} else {
- trace("FAILED: parseInt('-1234') == "+a);
-}
-a = parseInt('-1.234');
-if ( a == -1 ) {
- trace("PASSED: parseInt('-1.234')");
-} else {
- trace("FAILED: parseInt('-1.234') == "+a);
-}
-var a = parseInt('zero');
-if ( isNaN(a) ) {
- trace("PASSED: parseInt('zero') is NaN");
-} else {
- trace("FAILED: parseInt('zero') == "+a);
-}
-if ( ! isFinite(a) ) {
- trace("PASSED: parseInt('zero') is not finite");
-} else {
- trace("FAILED: parseInt('zero') == "+a);
-}
+check ( parseInt('45b') == 45 );
+check ( parseInt('65') == 65 );
+check ( parseInt('-1234') == -1234 );
+check ( parseInt('-1.234') == -1 );
+check ( isNaN(parseInt('zero')) );
+check ( !isFinite(parseInt('none')) );
// All %NN must become the corresponding ascii char
-var url = "http%3A%2F%2Fwww.gnu.org%3Fp%3Dgnash%26u%3Dyes";
-var unescaped = unescape(url);
-if ( unescaped == 'http://www.gnu.org?p=gnash&u=yes' ) {
- trace("PASSED: unescape");
-} else {
- trace("FAILED: unescape "+unescaped);
-}
+check ( unescape('%3A%2F%3F%3D%26') == ':/?=&' );
// How to test failure of setInterval and success of clearInterval ?
// The problem is that there is no way
@@ -89,8 +45,8 @@
INTERVALRUN=0;
INTERVALVARIABLE=undefined;
function intervalChecker() {
- trace("PASSED: setInterval");
- if ( INTERVALRUN ) trace("FAILED: clearInterval");
+ check("setInterval called" | true);
+ if ( INTERVALRUN ) check("clearInterval not called" & false);
INTERVALRUN=1;
clearInterval(INTERVALVARIABLE);
}
Index: gnash/testsuite/actionscript.all/Makefile.am
diff -u gnash/testsuite/actionscript.all/Makefile.am:1.11
gnash/testsuite/actionscript.all/Makefile.am:1.12
--- gnash/testsuite/actionscript.all/Makefile.am:1.11 Tue Feb 7 03:13:33 2006
+++ gnash/testsuite/actionscript.all/Makefile.am Thu Feb 9 00:37:25 2006
@@ -48,7 +48,33 @@
# @@ Is this still needed ?
# @@ Should we add all generated files ?
## moviecliploader_test_ming.swf definebitsjpeg2.swf
-GENERATED = xtrace.swf movieclip.swf array.swf
+##
+GENERATED = \
+ array.swf \
+ movieclip.swf \
+ Boolean.swf \
+ Camera.swf \
+ Color.swf \
+ ContextMenu.swf \
+ CustomActions.swf \
+ Date.swf \
+ Error.swf \
+ Global.swf \
+ LoadVars.swf \
+ Microphone.swf \
+ Mouse.swf \
+ NetStream.swf \
+ Selection.swf \
+ SharedObject.swf \
+ Stage.swf \
+ System.swf \
+ TextSnapshot.swf \
+ Video.swf \
+ Object.swf \
+ LocalConnection.swf \
+ NetConnection.swf \
+ XML.swf \
+ Function.swf
all: $(GENERATED)
Index: gnash/testsuite/actionscript.all/Object.as
diff -u gnash/testsuite/actionscript.all/Object.as:1.3
gnash/testsuite/actionscript.all/Object.as:1.4
--- gnash/testsuite/actionscript.all/Object.as:1.3 Sat Feb 4 15:28:30 2006
+++ gnash/testsuite/actionscript.all/Object.as Thu Feb 9 00:37:25 2006
@@ -21,92 +21,35 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-// Define USE_XTRACE to use "visual" trace
-#ifdef USE_XTRACE
-# include "xtrace.as"
-# define trace xtrace
-#endif
+#include "check.as"
// Test Object creation using 'new'
var obj = new Object; // uses SWFACTION_NEWOBJECT
-if (obj != undefined) {
- if ( typeof(obj) == "object" ) {
- trace("PASSED: 'new Object'");
- } else {
- trace("FAILED: 'new Object' is a "+typeof(TestClass));
- }
-} else {
- trace("FAILED: 'new Object' is undefined");
-}
+check (obj != undefined);
+check (typeof(obj) == "object");
// Test instantiated Object members
obj.member = 1;
-if ( obj.member == 1 ) {
- trace("PASSED: explicitly set member on instantiated Object is
correctly set");
-} else {
- if ( obj.member == undefined ) {
- trace("FAILED: explicitly set member on instantiated Object is
undefined");
- } else {
- trace("FAILED: explicitly set member on instantiated Object is
"+obj.member+" (should be 1)");
- }
-}
+check (obj.member == 1)
// Test Object creation using literal initialization
-var obj = { member:1 }; // uses SWFACTION_INITOBJECT
-
-if (obj != undefined) {
- if ( typeof(obj) == "object" ) {
- trace("PASSED: 'obj = { ... }' is of type 'object'");
- } else {
- trace("FAILED: 'obj = { ... }' is a "+typeof(obj));
- }
-} else {
- trace("FAILED: 'obj = { ... }' is undefined");
-}
+var obj2 = { member:1 }; // uses SWFACTION_INITOBJECT
+check (obj2 != undefined );
+check (typeof(obj2) == "object");
// Test initialized object members
-if ( obj.member == 1 ) {
- trace("PASSED: initialization-provided obj.member is correctly set");
-} else {
- if ( obj.member == undefined ) {
- trace("FAILED: initialization-provided obj.member is
undefined");
- } else {
- trace("FAILED: initialization-provided obj.member is
"+obj.member+" (should be 1)");
- }
-}
+check ( obj2.member == 1 )
// Test Object creation using initializing constructor
-var obj = new Object({ member:1 });
-if (obj != undefined) {
- if ( typeof(obj) == "object" ) {
- trace("PASSED: 'new Object({ ... })'");
- } else {
- trace("FAILED: 'new Object({ ... })' is a "+typeof(obj));
- }
-} else {
- trace("FAILED: 'new Object({...})' is undefined");
-}
+var obj3 = new Object({ member:1 });
+check (obj3 != undefined);
+check (typeof(obj3) == "object");
// Test initialized object members
-if ( obj.member == 1 ) {
- trace("PASSED: initialization-provided.member is correctly set");
-} else {
- if ( obj.member == undefined ) {
- trace("FAILED: initialization-provided obj.member is
undefined");
- } else {
- trace("FAILED: initialization-provided obj.member is
"+obj.member+" (should be 1)");
- }
-}
-
+check ( obj3.member != undefined );
+check ( obj3.member == 1 );
// Test after-initialization members set/get
-obj.member2 = 3;
-if ( obj.member2 == 3 ) {
- trace("PASSED: explicitly set obj.member2 is correctly set");
-} else {
- if ( obj.member == undefined ) {
- trace("FAILED: explicitly set obj.member2 is undefined");
- } else {
- trace("FAILED: explicitly set obj.member2 is "+obj.member2+"
(should be 1)");
- }
-}
+obj3.member2 = 3;
+check ( obj3.member2 != undefined );
+check ( obj3.member2 == 3 );