[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/registe...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/registe... |
Date: |
Thu, 01 Feb 2007 16:32:30 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/02/01 16:32:29
Modified files:
. : ChangeLog
testsuite/misc-ming.all: registerClassTest.c
registerClassTestRunner.cpp
Log message:
* testsuite/misc-ming.all/: registerClassTest.c,
registerClassTestRunner.cpp: made test more
complex, showing that the *constructor* of
the registered classes is called !
This currently fails.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2217&r2=1.2218
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTest.c?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTestRunner.cpp?cvsroot=gnash&r1=1.2&r2=1.3
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2217
retrieving revision 1.2218
diff -u -b -r1.2217 -r1.2218
--- ChangeLog 1 Feb 2007 15:47:33 -0000 1.2217
+++ ChangeLog 1 Feb 2007 16:32:29 -0000 1.2218
@@ -1,5 +1,13 @@
2007-02-01 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/: registerClassTest.c,
+ registerClassTestRunner.cpp: made test more
+ complex, showing that the *constructor* of
+ the registered classes is called !
+ This currently fails.
+
+2007-02-01 Sandro Santilli <address@hidden>
+
* server/parser/movie_def_impl.cpp (read_all_swf):
Perform a last check for "orphaned" actions, which are
action blocks NOT followed by a SHOWFRAME.
Index: testsuite/misc-ming.all/registerClassTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/registerClassTest.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/misc-ming.all/registerClassTest.c 23 Jan 2007 23:20:29 -0000
1.1
+++ testsuite/misc-ming.all/registerClassTest.c 1 Feb 2007 16:32:29 -0000
1.2
@@ -24,6 +24,8 @@
* 2) attach it to main timeline
* 3) register a custom class to it
* 4) attach it again (expected to have the custom class interface)
+ * 4) register another custom class to it, this time deriving from MovieClip
+ * 5) attach it again (expected to be both instance of custom class and
instance of MovieClip)
*
* run as ./registerClass
*/
@@ -115,17 +117,7 @@
SWFMovie_nextFrame(mo); /* end of frame2 */
add_actions(mo,
- "function CustomClass() { "
- "}"
- "CustomClass.prototype.moveRight = function(pix) {"
- " this._x += pix;"
- "};"
- "CustomClass.prototype.sayHello = function() {"
- " note('Hello from CustomClass instance');"
- "};"
- "MovieClip.prototype.sayHello = function() {"
- " note('Hello from MovieClip instance');"
- "};"
+ "function CustomClass() { this._x = 80; }"
"Object.registerClass('redsquare', CustomClass);"
);
@@ -133,26 +125,48 @@
"var name2 = 'square'+counter;"
"attachMovie('redsquare', name2, 70+counter);"
"var clip2 = this[name2];"
- "clip2.moveRight(80);" // TODO: test this!
"counter++;"
);
+ SWFMovie_nextFrame(mo); /* end of frame3 */
+
+ add_actions(mo,
+ "function CustomClass2() { this._x = 160; } "
+ "CustomClass2.prototype = new MovieClip;"
+ "Object.registerClass('redsquare', CustomClass2);"
+ );
+
+ add_actions(mo,
+ "var name3 = 'square'+counter;"
+ "attachMovie('redsquare', name3, 70+counter);"
+ "var clip3 = this[name3];"
+ "counter++;"
+ );
+
+ SWFMovie_nextFrame(mo); /* end of frame4 */
+
check_equals(mo, "typeof(clip1)", "'movieclip'");
check(mo, "clip1 instanceOf MovieClip");
+ check_equals(mo, "clip1._x", "0");
check(mo, "! clip1 instanceOf CustomClass");
check_equals(mo, "typeof(clip2)", "'movieclip'");
- /**/ check(mo, "clip2 instanceOf CustomClass");
- /**/ check(mo, "! clip2 instanceOf MovieClip");
+ check(mo, "clip2 instanceOf CustomClass");
+ xcheck_equals(mo, "clip2._x", "80");
+ check(mo, "! clip2 instanceOf MovieClip");
+
+ check_equals(mo, "typeof(clip3)", "'movieclip'");
+ xcheck_equals(mo, "clip3._x", "160");
+ check(mo, "clip3 instanceOf CustomClass2");
+ check(mo, "clip3 instanceOf MovieClip");
add_actions(mo,
"totals();"
"stop();"
);
- SWFMovie_nextFrame(mo); /* end of frame3 */
-
+ SWFMovie_nextFrame(mo); /* end of frame5 */
/*****************************************************
*
Index: testsuite/misc-ming.all/registerClassTestRunner.cpp
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/registerClassTestRunner.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/registerClassTestRunner.cpp 24 Jan 2007 10:11:54
-0000 1.2
+++ testsuite/misc-ming.all/registerClassTestRunner.cpp 1 Feb 2007 16:32:29
-0000 1.3
@@ -45,7 +45,7 @@
sprite_instance* root = tester.getRootMovie();
assert(root);
- check_equals(root->get_frame_count(), 3);
+ check_equals(root->get_frame_count(), 5);
check_equals(root->get_play_state(), sprite_instance::PLAY);
check_equals(root->get_current_frame(), 0);
@@ -56,23 +56,45 @@
check(!tester.isMouseOverMouseEntity());
tester.advance();
+ check_equals(root->get_current_frame(), 1);
check( tester.findDisplayItemByDepth(*root, 71) );
check(! tester.findDisplayItemByDepth(*root, 72) );
tester.movePointerTo(30, 30);
- /**/ check(tester.isMouseOverMouseEntity());
+ check(tester.isMouseOverMouseEntity());
tester.movePointerTo(100, 30);
check(!tester.isMouseOverMouseEntity());
tester.advance();
+ check_equals(root->get_current_frame(), 2);
check(tester.findDisplayItemByDepth(*root, 71) );
check(tester.findDisplayItemByDepth(*root, 72) );
tester.movePointerTo(30, 30);
- /**/ check(tester.isMouseOverMouseEntity());
+ check(tester.isMouseOverMouseEntity());
tester.movePointerTo(100, 30);
- /**/ check(tester.isMouseOverMouseEntity());
+ xcheck(tester.isMouseOverMouseEntity());
+
+ tester.advance();
+ check_equals(root->get_current_frame(), 3);
+
+ check(tester.findDisplayItemByDepth(*root, 71) );
+ check(tester.findDisplayItemByDepth(*root, 72) );
+ check(tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(30, 30);
+ check(tester.isMouseOverMouseEntity());
+ tester.movePointerTo(100, 30);
+ xcheck(tester.isMouseOverMouseEntity());
+ tester.movePointerTo(170, 30);
+ xcheck(tester.isMouseOverMouseEntity());
+
+ tester.advance();
+ check_equals(root->get_current_frame(), 4);
+
+ tester.advance();
+ check_equals(root->get_current_frame(), 4); // we should be in stop mode
}
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/registe...,
Sandro Santilli <=