[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_...
From: |
Zou Lunkai |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_... |
Date: |
Mon, 12 Mar 2007 07:10:57 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Zou Lunkai <zoulunkai> 07/03/12 07:10:57
Modified files:
. : ChangeLog
Added files:
testsuite/misc-ming.all: action_execution_order_test1.c
action_execution_order_test2.c
action_execution_order_test3.c
Log message:
new testcases to verify action execution order
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2605&r2=1.2606
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test1.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test2.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test3.c?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2605
retrieving revision 1.2606
diff -u -b -r1.2605 -r1.2606
--- ChangeLog 11 Mar 2007 17:51:09 -0000 1.2605
+++ ChangeLog 12 Mar 2007 07:10:56 -0000 1.2606
@@ -1,3 +1,10 @@
+2007-03-08 Zou Lunkai <address@hidden>
+
+ * testsuite/misc-ming.all/action_execution_order_test1.c.
+ * testsuite/misc-ming.all/action_execution_order_test2.c.
+ * testsuite/misc-ming.all/action_execution_order_test3.c.
+ 3 new testcases to verify action execution order.
+
2007-03-11 Deanna Phillips <deanna>
* cygnal/stream.cpp: Added #include <unistd.h>
Index: testsuite/misc-ming.all/action_execution_order_test1.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test1.c
diff -N testsuite/misc-ming.all/action_execution_order_test1.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test1.c 12 Mar 2007
07:10:57 -0000 1.1
@@ -0,0 +1,91 @@
+/*
+ * 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 2 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, address@hidden
+ *
+ * Within the same frame, ActionScripts in DoAction tags can referance
movieClip
+ * placed after DoAction tags.
+ *
+ * The actual order of tags are dependent on compiler, so you need to
+ * verify first if the order of tags is what you expect.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_test1.swf"
+
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ SWFMovieClip mc_red, dejagnuclip;
+ SWFShape sh_red;
+
+ 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, 12.0);
+
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0,
800, 600);
+ SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFMovie_nextFrame(mo); /* 1st frame */
+
+ /* This will add a DoAction Tag, which be compiled before
PlaceObject(mc_red) tag. */
+ check_equals(mo, "typeof(_root.mc_red)", "'movieclip'");
+
+ mc_red = newSWFMovieClip();
+ sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red, (SWFBlock)sh_red);
+ SWFMovieClip_nextFrame(mc_red);//1st frame
+
+ /* add mc_red to _root and name it as "mc_red" */
+ SWFDisplayItem it_red;
+ it_red = SWFMovie_add(mo, (SWFBlock)mc_red);
+ SWFDisplayItem_setDepth(it_red, 3);
+ SWFDisplayItem_setName(it_red, "mc_red");
+ SWFMovie_nextFrame(mo); /* 2nd frame */
+
+
+ add_actions(mo, " _root.totals(); stop(); ");
+ SWFMovie_nextFrame(mo); /* 3rd frame */
+
+ //Output movie
+ puts("Saving " OUTPUT_FILENAME );
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
+
+
+
Index: testsuite/misc-ming.all/action_execution_order_test2.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test2.c
diff -N testsuite/misc-ming.all/action_execution_order_test2.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test2.c 12 Mar 2007
07:10:57 -0000 1.1
@@ -0,0 +1,150 @@
+/*
+ * 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 2 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, address@hidden
+ *
+ * Within the same frame, if PlaceObject(mc1) is before PlaceObject(mc2),
+ * then actions in mc1 should be executed before actions in mc2. Otherwise,
after mc2.
+ *
+ * The actual order of tags are dependent on compiler, so you need to
+ * verify first if the order of tags is what you expect.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_test2.swf"
+
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ SWFMovieClip mc_red1, mc_red2, mc_red3, mc_red4, mc_red5, dejagnuclip;
+ SWFDisplayItem it_red1, it_red2, it_red3, it_red4, it_red5;
+ SWFShape sh_red;
+
+ 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, 12.0);
+
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0,
800, 600);
+ SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFMovie_nextFrame(mo); /* 1st frame */
+
+
+ mc_red1 = newSWFMovieClip();
+ sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red1, (SWFBlock)sh_red);
+ add_clip_actions(mc_red1, " _root.x1 += \"depth10+\"; ");
+ SWFMovieClip_nextFrame(mc_red1); /* mc_red1, 1st frame */
+ add_clip_actions(mc_red1, " _root.x2 += \"depth10+\"; stop(); ");
+ SWFMovieClip_nextFrame(mc_red1); /* mc_red1, 2nd frame */
+
+ mc_red2 = newSWFMovieClip();
+ sh_red = make_fill_square (80, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red2, (SWFBlock)sh_red);
+ add_clip_actions(mc_red2, " _root.x1 += \"depth12+\"; ");
+ SWFMovieClip_nextFrame(mc_red2); /* mc_red2, 1st frame */
+ add_clip_actions(mc_red2, " _root.x2 += \"depth12+\"; stop(); ");
+ SWFMovieClip_nextFrame(mc_red2); /* mc_red2, 2nd frame */
+
+ mc_red3 = newSWFMovieClip();
+ sh_red = make_fill_square (160, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red3, (SWFBlock)sh_red);
+ add_clip_actions(mc_red3, " _root.x1 += \"depth11+\"; ");
+ SWFMovieClip_nextFrame(mc_red3); /* mc_red3, 1st frame */
+ add_clip_actions(mc_red3, " _root.x2 += \"depth11+\"; stop();");
+ SWFMovieClip_nextFrame(mc_red3); /* mc_red3, 2nd frame */
+
+
+ /* add mc_red1 to _root and name it as "mc_red1" */
+ it_red1 = SWFMovie_add(mo, (SWFBlock)mc_red1);
+ SWFDisplayItem_setDepth(it_red1, 10);
+ SWFDisplayItem_setName(it_red1, "mc_red1");
+
+ /* add mc_red2 to _root and name it as "mc_red2" */
+ it_red2 = SWFMovie_add(mo, (SWFBlock)mc_red2);
+ SWFDisplayItem_setDepth(it_red2, 12);
+ SWFDisplayItem_setName(it_red2, "mc_red2");
+
+ /* add mc_red3 to _root and name it as "mc_red3" */
+ it_red3 = SWFMovie_add(mo, (SWFBlock)mc_red3);
+ SWFDisplayItem_setDepth(it_red3, 11);
+ SWFDisplayItem_setName(it_red3, "mc_red3");
+
+ SWFMovie_nextFrame(mo); /* 2nd frame */
+
+ /* Action order is not dependent on DisplayList depth here! */
+ xcheck_equals(mo, "_root.x1", "'depth10+depth12+depth11+'");
+ SWFMovie_nextFrame(mo); /* 3rd frame */
+
+ mc_red4 = newSWFMovieClip();
+ sh_red = make_fill_square (240, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red4, (SWFBlock)sh_red);
+ add_clip_actions(mc_red4, " _root.x2 += \"depth9+\"; ");
+ SWFMovieClip_nextFrame(mc_red4); /* mc_red4, 1st frame */
+
+ /* add mc_red4 to _root and name it as "mc_red4" */
+ it_red4 = SWFMovie_add(mo, (SWFBlock)mc_red4);
+ SWFDisplayItem_setDepth(it_red4, 9);
+ SWFDisplayItem_setName(it_red4, "mc_red4");
+
+ mc_red5 = newSWFMovieClip();
+ sh_red = make_fill_square (240, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red5, (SWFBlock)sh_red);
+ add_clip_actions(mc_red5, " _root.x2 += \"depth13+\"; ");
+ SWFMovieClip_nextFrame(mc_red5); /* mc_red4, 1st frame */
+
+ /* add mc_red5 to _root and name it as "mc_red5" */
+ it_red5 = SWFMovie_add(mo, (SWFBlock)mc_red5);
+ SWFDisplayItem_setDepth(it_red5, 13);
+ SWFDisplayItem_setName(it_red5, "mc_red4");
+
+ SWFMovie_nextFrame(mo); /* 4th frame */
+
+
+ xcheck_equals(mo, "_root.x2", "'depth11+depth12+depth10+depth9+depth13+'");
+ add_actions(mo, " _root.totals(); stop(); ");
+ SWFMovie_nextFrame(mo); /* 5th frame */
+
+
+ //Output movie
+ puts("Saving " OUTPUT_FILENAME );
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
+
+
+
Index: testsuite/misc-ming.all/action_execution_order_test3.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test3.c
diff -N testsuite/misc-ming.all/action_execution_order_test3.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test3.c 12 Mar 2007
07:10:57 -0000 1.1
@@ -0,0 +1,102 @@
+/*
+ * 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 2 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, address@hidden
+ *
+ * Within the same frame, if PlaceObject is after DoAction, then OnLoad is
also
+ * called after executing actionscripts in DoAction; if RemoveObject is after
DoAction,
+ * then OnUnload is also called after executing actionscripts in DoAction.
+ *
+ * The actual order of tags are dependent on compiler, so you need to
+ * verify first if the order of tags is what you expect.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_test3.swf"
+
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ SWFMovieClip mc_red1, mc_red2, mc_red3, dejagnuclip;
+ SWFShape sh_red;
+
+ 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, 12.0);
+
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0,
800, 600);
+ SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFMovie_nextFrame(mo); /* 1st frame */
+
+ add_actions(mo, "_root.x1 += \"as_in_DoAction+\"; ");
+
+ mc_red1 = newSWFMovieClip();
+ sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red1, (SWFBlock)sh_red);
+ SWFMovieClip_nextFrame(mc_red1); /* mc_red1, 1st frame */
+
+ /* add mc_red1 to _root and name it as "mc_red1" */
+ SWFDisplayItem it_red1, it_red2, it_red3;
+ it_red1 = SWFMovie_add(mo, (SWFBlock)mc_red1);
+ SWFDisplayItem_setDepth(it_red1, 10);
+ SWFDisplayItem_addAction(it_red1,
+ compileSWFActionCode("_root.x1 += \"onLoad+\";"),
+ SWFACTION_ONLOAD);
+ SWFDisplayItem_addAction(it_red1,
+ compileSWFActionCode("_root.x1 += \"onUnload+\";"),
+ SWFACTION_UNLOAD);
+ SWFDisplayItem_setName(it_red1, "mc_red1");
+
+ SWFMovie_nextFrame(mo); /* 2nd frame */
+
+ add_actions(mo, "_root.x1 += \"as_in_DoAction+\"; ");
+ SWFDisplayItem_remove(it_red1);
+ SWFMovie_nextFrame(mo); /* 3th frame */
+
+ check_equals(mo, "_root.x1",
"'as_in_DoAction+onLoad+as_in_DoAction+onUnload+'");
+ add_actions(mo, " _root.totals(); stop(); ");
+ SWFMovie_nextFrame(mo); /* 4th frame */
+
+ //Output movie
+ puts("Saving " OUTPUT_FILENAME );
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
+
+
+
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Zou Lunkai, 2007/03/05
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Sandro Santilli, 2007/03/05
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Zou Lunkai, 2007/03/08
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_...,
Zou Lunkai <=
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Zou Lunkai, 2007/03/15
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Zou Lunkai, 2007/03/19
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_..., Zou Lunkai, 2007/03/21