CVSROOT: /sources/gnash Module name: gnash Changes by: Zou Lunkai <zoulunkai> 07/09/27 04:40:24
Modified files: . : ChangeLog testsuite/misc-ming.all: Makefile.am testsuite/misc-swfc.all: edittext_test1.sc Added files: testsuite/misc-ming.all: opcode_guard_test.c Log message: CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4432&r2=1.4433 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.154&r2=1.155 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/opcode_guard_test.c?cvsroot=gnash&rev=1.1 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfc.all/edittext_test1.sc?cvsroot=gnash&r1=1.7&r2=1.8 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4432 retrieving revision 1.4433 diff -u -b -r1.4432 -r1.4433 --- ChangeLog 26 Sep 2007 21:48:31 -0000 1.4432 +++ ChangeLog 27 Sep 2007 04:40:23 -0000 1.4433 @@ -1,3 +1,9 @@ +2007-09-27 Zou Lunkai <[EMAIL PROTECTED]> + + * testsuite/misc-ming.all/opcode_guard_test.c, Makefile.am: new testcase + for opcode guard. + * testsuite/misc-swfc.all/edittext_test1.sc: more tests, passed. + 2007-09-26 Sandro Santilli <[EMAIL PROTECTED]> * server/sprite_instance.cpp (get_member): forget that Index: testsuite/misc-ming.all/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v retrieving revision 1.154 retrieving revision 1.155 diff -u -b -r1.154 -r1.155 --- testsuite/misc-ming.all/Makefile.am 19 Sep 2007 14:20:51 -0000 1.154 +++ testsuite/misc-ming.all/Makefile.am 27 Sep 2007 04:40:24 -0000 1.155 @@ -165,6 +165,7 @@ shape_test \ morph_test1 \ morph_test1runner \ + opcode_guard_test \ $(NULL) if MING_VERSION_0_4 @@ -248,6 +249,7 @@ registerClassTest2runner \ DefineEditTextVariableNameTest-Runner \ DefineEditTextVariableNameTest2-Runner \ + opcode_guard_testrunner \ $(NULL) if MAKESWF_SUPPORTS_PREBUILT_CLIPS @@ -330,6 +332,18 @@ spritehier_SOURCES = spritehier.c spritehier_LDADD = $(MING_LIBS) +opcode_guard_test_SOURCES = \ + opcode_guard_test.c \ + $(NULL) +opcode_guard_test_LDADD = libgnashmingutils.la + +opcode_guard_test.swf: opcode_guard_test + ./opcode_guard_test $(top_srcdir)/testsuite/media + +opcode_guard_testrunner: $(srcdir)/../generic-testrunner.sh opcode_guard_test.swf + sh $< $(top_builddir) opcode_guard_test.swf > $@ + chmod 755 $@ + PlaceObject2Test_SOURCES = \ PlaceObject2Test.c \ $(NULL) @@ -1750,6 +1764,7 @@ shape_testrunner \ morph_test1runner \ registerClassTest2runner \ + opcode_guard_testrunner \ $(NULL) if MING_VERSION_0_4 Index: testsuite/misc-swfc.all/edittext_test1.sc =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-swfc.all/edittext_test1.sc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -b -r1.7 -r1.8 --- testsuite/misc-swfc.all/edittext_test1.sc 26 Sep 2007 21:03:03 -0000 1.7 +++ testsuite/misc-swfc.all/edittext_test1.sc 27 Sep 2007 04:40:24 -0000 1.8 @@ -122,8 +122,9 @@ check_equals(typeof(edtext1), 'undefined'); .end - +// // new tests, seperate from the above +// .frame 9 .action: textVar4 = 'new_tests_begin'; @@ -149,10 +150,60 @@ check_equals(textVar4, 'value_changed'); .end +// +// new tests, seperate from the above +// +.frame 12 + .edittext edtext10 size=200% + width=100 height=100 + color=blue border multiline wordwrap + text="AAA" + variable="textVar10" + .edittext edtext11 size=200% + width=100 height=100 + color=blue border multiline wordwrap + text="BBB" + variable="textVar11" + .edittext edtext12 size=200% + width=100 height=100 + color=blue border multiline wordwrap + text="CCC" + variable="textVar12" + + .put edtext10 x=100 y=300 + .put edtext11 x=100 y=400 + .put edtext12 x=100 y=500 + + + .action: + check_equals(edtext10.text, 'AAA'); + check_equals(edtext11.text, 'BBB'); + check_equals(edtext12.text, 'CCC'); + edtext10.variable = "textVar11"; + edtext11.variable = "textVar12"; + edtext12.variable = "textVar10"; + check_equals(edtext10.text, 'BBB'); + check_equals(edtext11.text, 'CCC'); + check_equals(edtext12.text, 'AAA'); + check_equals(textVar10, 'AAA'); + check_equals(textVar11, 'BBB'); + check_equals(textVar12, 'CCC'); + .end + + +.frame 13 + .action: + edtext10.text = 'CCC'; + edtext11.text = 'BBB'; + edtext12.text = 'AAA'; + check_equals(textVar10, 'AAA'); + check_equals(textVar11, 'CCC'); + check_equals(textVar12, 'BBB'); + .end .frame 15 .action: - totals(31); + totals(43); stop(); .end Index: testsuite/misc-ming.all/opcode_guard_test.c =================================================================== RCS file: testsuite/misc-ming.all/opcode_guard_test.c diff -N testsuite/misc-ming.all/opcode_guard_test.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/misc-ming.all/opcode_guard_test.c 27 Sep 2007 04:40:24 -0000 1.1 @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2005, 2006, 2007 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 3 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 + * + */ + +/* + * Zou Lunkai, [EMAIL PROTECTED] + */ + +#include <stdlib.h> +#include <stdio.h> +#include <ming.h> + +#include "ming_utils.h" + +#define OUTPUT_VERSION 7 +#define OUTPUT_FILENAME "opcode_guard_test.swf" + + +int +main(int argc, char** argv) +{ + SWFMovie mo; + SWFMovieClip mc1, mc2, mc3, dejagnuclip; + SWFDisplayItem it1, it2, it3; + + const char *srcdir="."; + if ( argc>1 ) + srcdir=argv[1]; + else + { + fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]); + return 1; + } + + Ming_init(); + mo = newSWFMovieWithVersion(OUTPUT_VERSION); + SWFMovie_setDimension(mo, 800, 600); + SWFMovie_setRate (mo, 1); + + dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); + SWFMovie_add(mo, (SWFBlock)dejagnuclip); + SWFMovie_nextFrame(mo); // 1st frame + + + mc1 = newSWFMovieClip(); + // should be executed. + add_clip_actions(mc1, "_root.xcheck(false);"); + SWFMovieClip_nextFrame(mc1); + + + it1 = SWFMovie_add(mo, (SWFBlock)mc1); + SWFDisplayItem_setDepth(it1, 10); + SWFDisplayItem_setName(it1, "mc1"); + /* Define Construct ClipEvent */ + SWFDisplayItem_addAction(it1, + compileSWFActionCode(" _root.note('mc1 Construct called');" + " _root.gotoAndPlay(3); " + " _root.testvar1 = 'executed'; "), + SWFACTION_CONSTRUCT); + /* Define Load ClipEvent */ + SWFDisplayItem_addAction(it1, + compileSWFActionCode(" _root.note('mc1 Load called');" + " _root.gotoAndPlay(3); " + " _root.testvar2 = 'executed'; "), + SWFACTION_ONLOAD); + /* Define Unload ClipEvent */ + SWFDisplayItem_addAction(it1, + compileSWFActionCode(" _root.note('mc1 Unload called'); " + " _root.gotoAndPlay(3); " + " _root.testvar3 = 'executed'; "), + SWFACTION_UNLOAD); + /* Define EnterFrame ClipEvent */ + SWFDisplayItem_addAction(it1, + compileSWFActionCode(" _root.note('mc1 EnterFrame called'); " + " _root.gotoAndPlay(3); " + " _root.check(false); "), + SWFACTION_ENTERFRAME); + SWFMovie_nextFrame(mo); // 2nd frame + + + SWFDisplayItem_remove(it1); + SWFMovie_nextFrame(mo); // 3th frame + + check_equals(mo, "testvar1", "'executed'" ); + check_equals(mo, "testvar2", "'executed'" ); + check_equals(mo, "testvar3", "'executed'" ); + SWFMovie_nextFrame(mo); // 4th frame + + + mc2 = newSWFMovieClip(); + SWFMovieClip_nextFrame(mc2); + + it2 = SWFMovie_add(mo, (SWFBlock)mc2); + SWFDisplayItem_setDepth(it2, 12); + SWFDisplayItem_setName(it2, "mc2"); + + /* Define EnterFrame ClipEvent */ + SWFDisplayItem_addAction(it2, + compileSWFActionCode(" _root.note('mc2 EnterFrame called'); " + " _root.gotoAndPlay(8); " + " _root.xcheck(false); "), //should not be executed + SWFACTION_ENTERFRAME); + SWFMovie_nextFrame(mo); // 5th frame + + SWFMovie_nextFrame(mo); // 6th frame + SWFDisplayItem_remove(it2); + SWFMovie_nextFrame(mo); // 7th frame + SWFMovie_nextFrame(mo); // 8th frame + + add_actions(mo, "totals(); stop();"); + SWFMovie_nextFrame(mo); // 9th frame + + //Output movie + puts("Saving " OUTPUT_FILENAME ); + SWFMovie_save(mo, OUTPUT_FILENAME); + + return 0; +} _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit