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, 19 Mar 2007 09:41:02 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/03/19 09:41:02

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

Log message:
        more event tests

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2621&r2=1.2622
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test4.c?cvsroot=gnash&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2621
retrieving revision 1.2622
diff -u -b -r1.2621 -r1.2622
--- ChangeLog   19 Mar 2007 01:13:23 -0000      1.2621
+++ ChangeLog   19 Mar 2007 09:41:01 -0000      1.2622
@@ -1,3 +1,8 @@
+2007-03-19 Zou Lunkai <address@hidden>
+
+       * tesrttsuite/misc-ming.all/action_execution_order_test4.c.
+         add tests about onClipEvent(onConstruct) and user defined onLoad for 
_root
+         
 2007-03-18 Bastiaan Jacques
 
        * testsuite/libamf.all/test_number.cpp: Don't overflow the data buffer.

Index: testsuite/misc-ming.all/action_execution_order_test4.c
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/action_execution_order_test4.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/misc-ming.all/action_execution_order_test4.c      16 Mar 2007 
03:39:53 -0000      1.1
+++ testsuite/misc-ming.all/action_execution_order_test4.c      19 Mar 2007 
09:41:02 -0000      1.2
@@ -25,25 +25,28 @@
  *    (3) OnEnterFrame: last added first called; 
  *
  * 1st frame of _root: 
- *    place mc_red1 at depth 10
- *    place mc_red2 at depth 12
- *    place mc_red3 at depth 11
+ *    place mc1 at depth 10
+ *    place mc2 at depth 12
+ *    place mc3 at depth 11
  *
  * 4th frame of _root:
- *     remove mc_red1
- *     remove mc_red2 
- *     remove mc_red3 
+ *     remove mc1
+ *     remove mc2 
+ *     remove mc3 
  *
  * expected actions order:
- *     mc_red1.OnLoad; actions in 1st frame of mc_red1;
- *     mc_red2.OnLoad; actions in 1st frame of mc_red2;
- *     mc_red3.OnLoad; actions in 1st frame of mc_red3;
- *     mc_red3.OnEnterFrame; actions in 2nd frame of mc_red3;
- *     mc_red2.OnEnterFrame; actions in 2nd frame of mc_red2;
- *     mc_red1.OnEnterFrame; actions in 2nd frame of mc_red1;
- *     mc_red1.OnUnload; 
- *     mc_red2.OnUnload; 
- *     mc_red3.OnUnload; 
+ *     actions in 1st frame of _root; _root.OnLoad;
+ * (advanced to 2nd frame of _root)
+ *     mc1.OnConstruct; mc2.OnConstruct; mc3.OnConstruct;
+ *     mc1.OnLoad; actions in 1st frame of mc1;
+ *     mc2.OnLoad; actions in 1st frame of mc2;
+ *     mc3.OnLoad; actions in 1st frame of mc3;
+ *     mc3.OnEnterFrame; actions in 2nd frame of mc3;
+ *     mc2.OnEnterFrame; actions in 2nd frame of mc2;
+ *     mc1.OnEnterFrame; actions in 2nd frame of mc1;
+ *     mc1.OnUnload; 
+ *     mc2.OnUnload; 
+ *     mc3.OnUnload; 
  *
  * The actual order of tags are dependent on compiler, so you need to 
  * verify first if the order of tags is what you expect. 
@@ -63,8 +66,8 @@
 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;
+  SWFMovieClip  mc1, mc2, mc3, mc4, mc5, dejagnuclip;
+  SWFDisplayItem it1, it2, it3, it4, it5;
   SWFShape  sh_red;
 
   const char *srcdir=".";
@@ -83,117 +86,140 @@
 
   dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
   SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, " x2 += 'as_start+'; "
+                  " _root.OnLoad = function () { x2 += 'load_called+'; }; "
+                  " x2 += 'as_end+'; "
+                  " _root.onEnterFrame = function () { x3 += 
'enterFrame_called+'; }; ");
   SWFMovie_nextFrame(mo); /* 1st frame */
 
   
-  mc_red1 = newSWFMovieClip();
+  mc1 = 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.note('actions in 1st frame of mc_red1'); "
+  SWFMovieClip_add(mc1, (SWFBlock)sh_red);  
+  add_clip_actions(mc1, " _root.note('actions in 1st frame of mc1'); "
                             " _root.x1 += '2+'; ");
-  SWFMovieClip_nextFrame(mc_red1); /* mc_red1, 1st frame */
-  add_clip_actions(mc_red1, " _root.note('actions in 2nd frame of mc_red1'); "
+  SWFMovieClip_nextFrame(mc1); /* mc1, 1st frame */
+  add_clip_actions(mc1, " _root.note('actions in 2nd frame of mc1'); "
                             " _root.x1 += '12+'; "
                             " stop(); ");
-  SWFMovieClip_nextFrame(mc_red1); /* mc_red1, 2nd frame */
+  SWFMovieClip_nextFrame(mc1); /* mc1, 2nd frame */
  
-  mc_red2 = newSWFMovieClip();
+  mc2 = 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.note('actions in 1st frame of mc_red2'); "
+  SWFMovieClip_add(mc2, (SWFBlock)sh_red); 
+  add_clip_actions(mc2, " _root.note('actions in 1st frame of mc2'); "
                             " _root.x1 += '4+'; "); 
-  SWFMovieClip_nextFrame(mc_red2); /* mc_red2, 1st frame */
-  add_clip_actions(mc_red2, " _root.note('actions in 2nd frame of mc_red2'); "
+  SWFMovieClip_nextFrame(mc2); /* mc2, 1st frame */
+  add_clip_actions(mc2, " _root.note('actions in 2nd frame of mc2'); "
                             " _root.x1 += '10+'; "
                             " stop(); "); 
-  SWFMovieClip_nextFrame(mc_red2); /* mc_red2, 2nd frame */
+  SWFMovieClip_nextFrame(mc2); /* mc2, 2nd frame */
   
-  mc_red3 = newSWFMovieClip();
+  mc3 = 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.note('actions in 1st frame of mc_red3'); "
+  SWFMovieClip_add(mc3, (SWFBlock)sh_red);  
+  add_clip_actions(mc3, " _root.note('actions in 1st frame of mc3'); "
                             " _root.x1 += '6+';"); 
-  SWFMovieClip_nextFrame(mc_red3); /* mc_red3, 1st frame */
-  add_clip_actions(mc_red3, " _root.note('actions in 2nd frame of mc_red3'); "
+  SWFMovieClip_nextFrame(mc3); /* mc3, 1st frame */
+  add_clip_actions(mc3, " _root.note('actions in 2nd frame of mc3'); "
                             " _root.x1 += '8+'; "
                             " stop(); "); 
-  SWFMovieClip_nextFrame(mc_red3); /* mc_red3, 2nd frame */
+  SWFMovieClip_nextFrame(mc3); /* mc3, 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"); 
-  /* Define onLoad ClipEvent */
-  SWFDisplayItem_addAction(it_red1,
-    compileSWFActionCode(" _root.note('mc_red1 onLoad called');"
+  /* 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.x0 += '01+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 Load called');"
                          " _root.x1 += '1+'; "),
     SWFACTION_ONLOAD);
   /* Define Unload ClipEvent */
-  SWFDisplayItem_addAction(it_red1,
-    compileSWFActionCode(" _root.note('mc_red1 onUnload called'); "
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 Unload called'); "
                          " _root.x1 += '13+'; "),
     SWFACTION_UNLOAD);
-  /* Define onEnterFrame ClipEvent */
-  SWFDisplayItem_addAction(it_red1,
-    compileSWFActionCode(" _root.note('mc_red1 onEnterFrame called'); "
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it1,
+    compileSWFActionCode(" _root.note('mc1 EnterFrame called'); "
                          " _root.x1 += '11+'; "),
     SWFACTION_ENTERFRAME);
     
-  /* 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"); 
-  /* Define onLoad ClipEvent */
-  SWFDisplayItem_addAction(it_red2,
-    compileSWFActionCode(" _root.note('mc_red2 onLoad called'); "
+  /* 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.x0 += '02+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 Load called'); "
                          " _root.x1 += '3+'; "),
     SWFACTION_ONLOAD);
   /* Define Unload ClipEvent */
-  SWFDisplayItem_addAction(it_red2,
-    compileSWFActionCode(" _root.note('mc_red2 onUnload called'); "
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 Unload called'); "
                          " _root.x1 += '14+'; "),
     SWFACTION_UNLOAD);
-  /* Define onEnterFrame ClipEvent */
-  SWFDisplayItem_addAction(it_red2,
-    compileSWFActionCode(" _root.note('mc_red2 onEnterFrame called'); "
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it2,
+    compileSWFActionCode(" _root.note('mc2 EnterFrame called'); "
                          " _root.x1 += '9+'; "),
     SWFACTION_ENTERFRAME);
     
-  /* 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"); 
-  /* Define onLoad ClipEvent */
-  SWFDisplayItem_addAction(it_red3,
-    compileSWFActionCode(" _root.note('mc_red3 onLoad called'); "
+  /* 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.x0 += '03+'; "),
+    SWFACTION_CONSTRUCT);
+  /* Define Load ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 Load called'); "
                          " _root.x1 += '5+'; "),
     SWFACTION_ONLOAD);
-  /* Define onUnload ClipEvent */
-  SWFDisplayItem_addAction(it_red3,
-    compileSWFActionCode(" _root.note('mc_red3 onUnload called'); "
+  /* Define Unload ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 Unload called'); "
                          " _root.x1 += '15+';" ),
     SWFACTION_UNLOAD);
-  /* Define onEnterFrame ClipEvent */
-  SWFDisplayItem_addAction(it_red3,
-    compileSWFActionCode(" _root.note('mc_red3 onEnterFrame called'); "
+  /* Define EnterFrame ClipEvent */
+  SWFDisplayItem_addAction(it3,
+    compileSWFActionCode(" _root.note('mc3 EnterFrame called'); "
                          " _root.x1 += '7+'; "),
     SWFACTION_ENTERFRAME);
     
+  add_actions(mo, " _root.x3 += '_root_frm2_as+'; ");
   SWFMovie_nextFrame(mo); /* 2nd frame */
 
-
+  add_actions(mo, " _root.x3 += '_root_frm3_as+'; ");
+  check_equals(mo, "_root.x3", 
"'enterFrame_called+_root_frm2_as+enterFrame_called+_root_frm3_as+'");
   SWFMovie_nextFrame(mo); /* 3rd frame */
   
   /* It's no use to change the order below.
   After compile, Ming will re-organize them as 
-  remove mc_red1; remove mc_red2; remove mc_red3;*/
-  SWFDisplayItem_remove(it_red3);  
-  SWFDisplayItem_remove(it_red1);
-  SWFDisplayItem_remove(it_red2);
+  remove mc1; remove mc2; remove mc3;*/
+  SWFDisplayItem_remove(it3);  
+  SWFDisplayItem_remove(it1);
+  SWFDisplayItem_remove(it2);
   SWFMovie_nextFrame(mo); /* 4th frame */
 
+  check_equals(mo, "_root.x0", "'01+02+03+'");
   xcheck_equals(mo, "_root.x1", "'1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+'");
+  check_equals(mo, "_root.x2", "'as_start+as_end+load_called+'");
   add_actions(mo, " _root.totals(); stop(); ");
   SWFMovie_nextFrame(mo); /* 5th frame */
   




reply via email to

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