gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r12177: Fix and expand test.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12177: Fix and expand test.
Date: Thu, 06 May 2010 15:01:02 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12177 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2010-05-06 15:01:02 +0200
message:
  Fix and expand test.
modified:
  libcore/MovieClip.cpp
  libcore/MovieClip.h
  testsuite/misc-ming.all/InitActionTest2.c
=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2010-05-06 10:19:43 +0000
+++ b/libcore/MovieClip.cpp     2010-05-06 11:25:42 +0000
@@ -535,18 +535,16 @@
     //             we'll temporarly clear the _callingFrameActions flag
     //             to properly queue actions back on the global queue.
     //
-    _callingFrameActions=true;
+    _callingFrameActions = true;
     const PlayList* playlist = _def->getPlaylist(frame_number);
-    if ( playlist )
-    {
-    PlayList::const_iterator it = playlist->begin();
+    if (playlist) {
+        PlayList::const_iterator it = playlist->begin();
         const PlayList::const_iterator e = playlist->end();
-    for(; it != e; it++)
-    {
-        (*it)->execute_action(this, _displayList);
-    }
-    }
-    _callingFrameActions=false;
+        for(; it != e; it++) {
+            (*it)->execute_action(this, _displayList);
+        }
+    }
+    _callingFrameActions = false;
 
 }
 

=== modified file 'libcore/MovieClip.h'
--- a/libcore/MovieClip.h       2010-03-11 17:03:04 +0000
+++ b/libcore/MovieClip.h       2010-05-06 12:11:30 +0000
@@ -431,9 +431,9 @@
     /// Add the given action buffer to the list of action
     /// buffers to be processed at the end of the next
     /// frame advance.
-    void    add_action_buffer(const action_buffer* a)
+    void add_action_buffer(const action_buffer* a)
     {
-        if ( ! _callingFrameActions ) queueAction(*a);
+        if (!_callingFrameActions) queueAction(*a);
         else execute_action(*a);
     }
 

=== modified file 'testsuite/misc-ming.all/InitActionTest2.c'
--- a/testsuite/misc-ming.all/InitActionTest2.c 2010-05-06 09:23:32 +0000
+++ b/testsuite/misc-ming.all/InitActionTest2.c 2010-05-06 12:11:37 +0000
@@ -38,21 +38,26 @@
 
     // Export it.
     SWFMovie_addExport(mo, (SWFBlock)mc2, "C2");
-       SWFMovie_writeExports(mo);
+    SWFMovie_writeExports(mo);
 
     // Main timeline actions for frame 1
-    add_actions(mo, "trace('frame 1'); gotoAndStop(3);");
+    add_actions(mo, "var c = 0; trace('frame 1'); gotoAndStop(3);");
     
     // ID 3 is defined here. It has no showframe. It is exported immediately.
     mc3 = newSWFMovieClip();
     SWFMovie_addExport(mo, (SWFBlock)mc3, "ctor");
-       SWFMovie_writeExports(mo);
+    SWFMovie_writeExports(mo);
+
+    dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10,
+                   0, 0, 800, 600);
+    SWFMovie_add(mo, (SWFBlock)dejagnuclip);
 
     // Init actions for ID 3
     ac = newSWFAction(
     "   _global.ctor = function () {"
     "       super();"
     "       trace('Object in Frame 2 is constructed');"
+    "       c += 1;"
     "   };"
     );
     SWFInitAction ia = newSWFInitAction_withId(ac, 3);
@@ -69,14 +74,42 @@
     SWFMovie_nextFrame(mo);
     add_actions(mo, "trace('Frame 2');");
     
-    // Place object ID 2 (should be skipped).
+    // Place object ID 2.
     it = SWFMovie_add(mo, (SWFBlock)mc2);
-    
+    SWFDisplayItem_setName(it, "mc2");
+
     // Frame 3
     SWFMovie_nextFrame(mo);
 
+    // Remove object ID 2
+    SWFMovie_remove(mo, it);
+
     add_actions(mo, "trace('frame 3');");
     
+    // The class should not be constructed if the object is removed after
+    // being placed. It should be constructed if it's not removed.
+    xcheck(mo, "c == 0");
+    check(mo, "_root.mc2 == undefined");
+    add_actions(mo, "gotoAndStop(5);");
+
+    // Frame 4
+    SWFMovie_nextFrame(mo);
+    add_actions(mo, "trace('Frame 4');");
+    
+    // Place object ID 2 again
+    it = SWFMovie_add(mo, (SWFBlock)mc2);
+    SWFDisplayItem_setName(it, "mc2a");
+
+    // Frame 5
+    SWFMovie_nextFrame(mo);
+
+    // This time the MovieClip was not removed before we get here,
+    // so it should be present and the constructor should be
+    // called.
+    add_actions(mo, "trace('frame 5');");
+    xcheck(mo, "c == 1");
+    check(mo, "typeof(_root.mc2a) == 'movieclip'");
+
     SWFMovie_nextFrame(mo);
   
     puts("Saving " OUTPUT_FILENAME );


reply via email to

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