gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Thu, 22 Mar 2007 08:10:51 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/03/22 08:10:51

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: action_execution_order_test6.c 

Log message:
        new testcase for passing-by MovieClip events

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2668&r2=1.2669
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test6.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2668
retrieving revision 1.2669
diff -u -b -r1.2668 -r1.2669
--- ChangeLog   22 Mar 2007 00:30:45 -0000      1.2668
+++ ChangeLog   22 Mar 2007 08:10:50 -0000      1.2669
@@ -1,3 +1,9 @@
+2007-03-22 Zou Lunkai <address@hidden>
+
+       * testsuite/misc-ming.all: action_execution_order_test6.c, Makefile.am.
+         add a new testcase for passing-by MovieClip events.
+
+         
 2007-03-22 Sandro Santilli <address@hidden>
 
        * testsuite/swfdec/PASSING: comparisons-7.swf now passes.

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- testsuite/misc-ming.all/Makefile.am 16 Mar 2007 08:23:20 -0000      1.80
+++ testsuite/misc-ming.all/Makefile.am 22 Mar 2007 08:10:51 -0000      1.81
@@ -91,6 +91,7 @@
        action_execution_order_test3 \
        action_execution_order_test4 \
        action_execution_order_test5 \
+       action_execution_order_test6 \
        loadMovieTest \
        loadMovieTestRunner \
        eventSoundTest1 \
@@ -120,6 +121,7 @@
        action_execution_order_test3runner \
        action_execution_order_test4runner \
        action_execution_order_test5runner \
+       action_execution_order_test6runner \
        $(NULL)
 
 if MAKESWF_SUPPORTS_PREBUILT_CLIPS
@@ -532,6 +534,20 @@
        sh $< $(top_builddir) action_execution_order_test5.swf > $@
        chmod 755 $@
 
+action_execution_order_test6_SOURCES = \
+       action_execution_order_test6.c  \
+       ming_utils.h            \
+       ming_utils.c            \
+       $(NULL)
+action_execution_order_test6_LDADD = $(MING_LIBS)
+
+action_execution_order_test6.swf: action_execution_order_test6
+       ./action_execution_order_test6 $(top_srcdir)/testsuite/media
+
+action_execution_order_test6runner: $(srcdir)/../generic-testrunner.sh 
action_execution_order_test6.swf
+       sh $< $(top_builddir) action_execution_order_test6.swf > $@
+       chmod 755 $@
+       
 action_execution_order_extend_test_SOURCES =   \
        action_execution_order_extend_test.c    \
        ming_utils.h            \

Index: testsuite/misc-ming.all/action_execution_order_test6.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test6.c
diff -N testsuite/misc-ming.all/action_execution_order_test6.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test6.c      22 Mar 2007 
08:10:51 -0000      1.1
@@ -0,0 +1,238 @@
+/*
+ *   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
+ *
+ * To verify that:
+ *    onClipConstruct, onClipLoad and onClipUnload are triggerd for passing-by 
MovieClips.
+ *
+ * 1st frm of _root
+ *     place dejagunClip;
+ * 2nd frm of _root: 
+ *    gotoAndPlay(9);
+ * 3rd frm of _root:
+ *    place mc1 and  mc2;
+ * 4th frm of _root:
+ *    stop and do checks
+ * 5th frm of _root
+ *    gotoAndPlay(4);
+ *    remove mc1 and mc2; 
+ * 6th frm of _root
+ *    place mc3;
+ * 7th frm of _root
+ *    do nothing;
+ * 8th frm of _root
+ *    remove mc3;
+ * 9th frm of _root
+ *    gotoAndPlay(5);
+ *  
+ * expected actions order:
+ * At frame2 go forward to frame9:
+ *   mc1.Construct 
+ *   mc2.Construct
+ *   mc3.Construct
+ *   mc1.Load
+ *   mc2.Load
+ *   mc1.Unload
+ *   mc2.Unload
+ *   mc3.Load
+ *   mc3.Unload
+ * At frame9 go backward to frame5:
+ *   (no events triggered)
+ * At frame5 go backward to frame4:
+ *   mc1.Construct
+ *   mc2.Construct
+ *   mc1.Load
+ *     actions in 1st frame of mc1
+ *   mc2.Load 
+ *     actions in 1st frame of 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  7
+#define OUTPUT_FILENAME "action_execution_order_test6.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc1, mc2, mc3, mc4, mc5, dejagnuclip;
+  SWFDisplayItem it1, it2, it3, it4, it5;
+  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, 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 */
+  
+  add_actions(mo, " _root.x1=''; gotoAndPlay(9);");
+  SWFMovie_nextFrame(mo); /* 2nd frame */
+  
+  mc1 = newSWFMovieClip();
+  add_clip_actions(mc1, " _root.note('actions in 1st frame of mc1'); "
+                        " _root.x1 += 'x+'; ");
+  SWFMovieClip_nextFrame(mc1); /* mc1, 1st frame */
+  add_clip_actions(mc1, " _root.note('actions in 2nd frame of mc1'); "
+                        " _root.x1 += 'x+'; "
+                        " stop(); ");
+  SWFMovieClip_nextFrame(mc1); /* mc1, 2nd frame */
+ 
+  mc2 = newSWFMovieClip();
+  add_clip_actions(mc2, " _root.note('actions in 1st frame of mc2'); "
+                        " _root.x1 += 'xx+'; "); 
+  SWFMovieClip_nextFrame(mc2); /* mc2, 1st frame */
+  add_clip_actions(mc2, " _root.note('actions in 2nd frame of mc2'); "
+                        " _root.x1 += 'xx+'; "
+                        " stop(); "); 
+  SWFMovieClip_nextFrame(mc2); /* mc2, 2nd frame */
+  
+  mc3 = newSWFMovieClip();
+  add_clip_actions(mc3, " _root.note('actions in 1st frame of mc3'); "
+                        " _root.x1 += 'xxx+'; "); 
+  SWFMovieClip_nextFrame(mc3); /* mc3, 1st frame */
+  add_clip_actions(mc3, " _root.note('actions in 2nd frame of mc3'); "
+                        " _root.x1 += 'xxx+'; "
+                        " stop(); "); 
+  SWFMovieClip_nextFrame(mc3); /* mc3, 2nd frame */
+  
+  
+  /* add mc1 to _root and name it as "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.x1 += '1+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 Load called');"
+                         " _root.x1 += '4+'; "),
+    SWFACTION_ONLOAD);
+  /* Define Unload ClipEvent */
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 Unload called'); "
+                         " _root.x1 += '6+'; "),
+    SWFACTION_UNLOAD);
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 EnterFrame called'); "), 
+    SWFACTION_ENTERFRAME);
+    
+  /* add mc2 to _root and name it as "mc2" */
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2);  
+  SWFDisplayItem_setDepth(it2, 12); 
+  SWFDisplayItem_setName(it2, "mc2"); 
+  /* Define Construct ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 Construct called');"
+                         " _root.x1 += '2+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 Load called'); "
+                         " _root.x1 += '5+'; "),
+    SWFACTION_ONLOAD);
+  /* Define Unload ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 Unload called'); "
+                         " _root.x1 += '7+'; "),
+    SWFACTION_UNLOAD);
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 EnterFrame called'); "),
+    SWFACTION_ENTERFRAME);
+    
+  SWFMovie_nextFrame(mo); /* 3rd frame */
+  
+  check_equals(mo, "_root.x1", "'1+2+3+4+5+6+7+8+9+1+2+4+x+5+xx+'");
+  add_actions(mo, " _root.totals(); stop(); ");
+  SWFMovie_nextFrame(mo); /* 4th frame */
+  
+  add_actions(mo, " gotoAndPlay(4); ");
+  SWFDisplayItem_remove(it1);
+  SWFDisplayItem_remove(it2);
+  SWFMovie_nextFrame(mo); /* 5th frame */
+  
+  /* add mc3 to _root and name it as "mc3" */
+  it3 = SWFMovie_add(mo, (SWFBlock)mc3);  
+  SWFDisplayItem_setDepth(it3, 11); 
+  SWFDisplayItem_setName(it3, "mc3"); 
+  /* Define Construct ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 Construct called');"
+                         " _root.x1 += '3+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 Load called'); "
+                         " _root.x1 += '8+'; "),
+    SWFACTION_ONLOAD);
+  /* Define Unload ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 Unload called'); "
+                         " _root.x1 += '9+';" ),
+    SWFACTION_UNLOAD);
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 EnterFrame called'); "),
+    SWFACTION_ENTERFRAME);
+  
+  SWFMovie_nextFrame(mo); /* 6th frame */
+  SWFMovie_nextFrame(mo); /* 7th frame */
+
+  SWFDisplayItem_remove(it3); 
+  SWFMovie_nextFrame(mo); /* 8th frame */
+  
+  add_actions(mo, " gotoAndPlay(5); ");
+  SWFMovie_nextFrame(mo); /* 9th frame */
+  
+  
+  //Output movie
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}
+
+
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]