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/action_...


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_...
Date: Mon, 30 Apr 2007 05:41:29 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/04/30 05:41:29

Modified files:
        .              : ChangeLog 
Added files:
        testsuite/misc-ming.all: action_execution_order_test8.c 

Log message:
        another testcase about execution order

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3035&r2=1.3036
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test8.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3035
retrieving revision 1.3036
diff -u -b -r1.3035 -r1.3036
--- ChangeLog   30 Apr 2007 02:16:49 -0000      1.3035
+++ ChangeLog   30 Apr 2007 05:41:28 -0000      1.3036
@@ -2,6 +2,8 @@
 
        * testsuite/misc-ming.all/action_execution_order_test7.c:
          a simple and normal one that we should pass.
+       * testsuite/misc-ming.all/action_execution_order_test8.c:
+               another one for execution order.
          
 2007-04-29 Sandro Santilli <address@hidden>
 

Index: testsuite/misc-ming.all/action_execution_order_test8.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test8.c
diff -N testsuite/misc-ming.all/action_execution_order_test8.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test8.c      30 Apr 2007 
05:41:29 -0000      1.1
@@ -0,0 +1,105 @@
+/*
+ *   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
+ *
+ */ 
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_test8.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc1, mc2, dejagnuclip;
+  SWFDisplayItem it1, it2;
+  
+  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, " if(check == 1) gotoAndPlay(4); ");
+  SWFMovie_nextFrame(mo); /* 2nd frame */
+  
+  add_actions(mo, " check = 1; gotoAndPlay(2); ");
+  SWFMovie_nextFrame(mo); /* 3rd frame */
+  
+  
+  mc1 = newSWFMovieClip();
+  add_clip_actions(mc1, " _root.gotoAndStop(6);"
+                        " _root.x = 100; " );
+  SWFMovieClip_nextFrame(mc1);
+  
+  /* add mc1 to _root and name it as "mc1" */
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1);  
+  SWFDisplayItem_setDepth(it1, 3); 
+  SWFDisplayItem_setName(it1, "mc1"); 
+  check_equals(mo, "typeof(_root.x)", "'undefined'");
+  add_actions(mo, " _root.x = 200; ");
+  SWFMovie_nextFrame(mo); /* 4th frame */
+
+
+  SWFDisplayItem_remove(it1);
+  
+  mc2 = newSWFMovieClip();
+  // these actions are expected to be skipped with SWF version higher then 4
+  add_clip_actions(mc2, " _root.note(' your player version is lower than  5');"
+                        " _root.note(' Or your player is bogus'); "
+                        " fail = 0; "
+                        //this should not be executed with SWF6
+                        " _root.xcheck_equals(fail, 1); " ); 
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2);  
+  SWFDisplayItem_setDepth(it2, 3); 
+  SWFDisplayItem_setName(it2, "mc2"); 
+  SWFMovieClip_nextFrame(mc2);
+  add_actions(mo, " stop(); ");  
+   
+  SWFMovie_nextFrame(mo); /* 5th frame */
+
+  SWFDisplayItem_remove(it2);
+  check_equals(mo, "_root.x", "200");
+  add_actions(mo, " _root.totals(); stop(); ");
+  SWFMovie_nextFrame(mo); /* 6th 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]