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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/loop_te...
Date: Thu, 24 May 2007 07:31:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/24 07:31:45

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

Log message:
                * testsuite/misc-ming.all/: Makefile.am,
                  loop_test6.c, loop_test7.c:
                  Add a clone of "Jumping backward to the end of a character's
                  lifetime" test this time with onUnload defined.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3328&r2=1.3329
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test6.c?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.128&r2=1.129
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test7.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3328
retrieving revision 1.3329
diff -u -b -r1.3328 -r1.3329
--- ChangeLog   24 May 2007 06:45:29 -0000      1.3328
+++ ChangeLog   24 May 2007 07:31:44 -0000      1.3329
@@ -1,5 +1,12 @@
 2007-05-24 Sandro Santilli <address@hidden>
 
+       * testsuite/misc-ming.all/: Makefile.am,
+         loop_test6.c, loop_test7.c:
+         Add a clone of "Jumping backward to the end of a character's
+         lifetime" test this time with onUnload defined.
+
+2007-05-24 Sandro Santilli <address@hidden>
+
        * testsuite/misc-ming.all/: replace_shapes1test.c,
          replace_sprites1test.c: SWFMovie_replace returns 0 on success
          and non-0 on failure. Fixed code to reflect that (I'm not sure

Index: testsuite/misc-ming.all/loop_test6.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loop_test6.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/misc-ming.all/loop_test6.c        23 May 2007 18:59:44 -0000      
1.1
+++ testsuite/misc-ming.all/loop_test6.c        24 May 2007 07:31:45 -0000      
1.2
@@ -17,7 +17,7 @@
  */ 
 
 /*
- * Test "Jumping backward to the end of a character's lifetime"
+ * Test "Jumping backward to the end of a character's lifetime (with events: 
onConstruct)"
  *
  * Timeline:
  * 
@@ -33,13 +33,13 @@
  * Description:
  *
  *  frame2: a static characters is placed at depth 3 (-16381) [ a red square ]
+ *          onConstruct event handler defined, onUnload event handlers NOT 
defined
  *  frame3: character at depth 3 (-16381) removed
  *  frame5: jump back to frame 4 and stop
  *
  * Expected behaviour:
  *
- *   After jump back, a single instance have been created.
- *   It's onConstruct event handler has been invoked once.
+ *   After jump back, the onConstruct event handler for the red square has 
been invoked only once.
  *
  * run as ./loop_test6
  */

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- testsuite/misc-ming.all/Makefile.am 23 May 2007 18:59:44 -0000      1.128
+++ testsuite/misc-ming.all/Makefile.am 24 May 2007 07:31:45 -0000      1.129
@@ -81,6 +81,7 @@
        loop_test4 \
        loop_test5 \
        loop_test6 \
+       loop_test7 \
        loop_test-Runner \
        place_object_test \
        move_object_test \
@@ -214,6 +215,7 @@
        loop_test4runner \
        loop_test5runner \
        loop_test6runner \
+       loop_test7runner \
        shape_testrunner \
        $(NULL)
 
@@ -425,6 +427,16 @@
        sh $< -f20 $(top_builddir) loop_test6.swf > $@
        chmod 755 $@
 
+loop_test7_SOURCES = loop_test7.c
+loop_test7_LDADD = libgnashmingutils.la
+
+loop_test7.swf: loop_test7
+       ./loop_test7 $(top_srcdir)/testsuite/media
+
+loop_test7runner: $(srcdir)/../generic-testrunner.sh loop_test7.swf
+       sh $< -f20 $(top_builddir) loop_test7.swf > $@
+       chmod 755 $@
+
 shape_test_SOURCES = shape_test.c
 shape_test_LDADD = libgnashmingutils.la
 
@@ -1430,6 +1442,7 @@
        loop_test4runner \
        loop_test5runner \
        loop_test6runner \
+       loop_test7runner \
        shape_testrunner \
        $(NULL)
 

Index: testsuite/misc-ming.all/loop_test7.c
===================================================================
RCS file: testsuite/misc-ming.all/loop_test7.c
diff -N testsuite/misc-ming.all/loop_test7.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/loop_test7.c        24 May 2007 07:31:45 -0000      
1.1
@@ -0,0 +1,149 @@
+/* 
+ *   Copyright (C) 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
+ *
+ */ 
+
+/*
+ * Test "Jumping backward to the end of a character's lifetime (with events: 
onConstruct, onUnload)"
+ *
+ * Timeline:
+ * 
+ *   Frame  | 1 | 2 | 3 | 4 | 5 | 6 |
+ *  --------+---+---+---+---+---+---+
+ *   Event  |   | P | R | * | J |   |
+ * 
+ *  P = place (by PlaceObject2)
+ *  R = remove (by RemoveObject* tag)
+ *  J = jump
+ *  * = jump target
+ *
+ * Description:
+ *
+ *  frame2: a static characters is placed at depth 3 (-16381) [ a red square ]
+ *          Both onConstruct and onUnload event handlers defined.
+ *  frame3: character at depth 3 (-16381) removed
+ *  frame5: jump back to frame 4 and stop
+ *
+ * Expected behaviour:
+ *
+ *   TODO: verify
+ *   After jump back, the onConstruct event handler for the red square has 
been invoked twice.
+ *
+ * run as ./loop_test7
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "loop_test7.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip mc1, mc2, dejagnuclip;
+  SWFDisplayItem it1, it2;
+  SWFShape  sh1,sh2;
+  SWFAction ac;
+  int i;
+
+  const char *srcdir=".";
+  if ( argc>1 ) 
+    srcdir=argv[1];
+  else
+  {
+      //fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+      //return 1;
+  }
+
+  Ming_init();
+  Ming_useSWFVersion (OUTPUT_VERSION);
+  
+  mo = newSWFMovie();
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate(mo, 6);
+
+  // Frame 1: Place dejagnu clip
+
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, "mc1Constructed=0; mc2Constructed=0; mc3Constructed=0; 
mc4Constructed=0;");
+  SWFMovie_nextFrame(mo); 
+  
+  //
+  // Frame 2: 
+  //   Place red static movieClip1 character at depth 3 (-16381)
+  //
+  sh1 = make_fill_square (300, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+  mc1 = newSWFMovieClip();
+  SWFMovieClip_add(mc1, (SWFBlock)sh1); 
+  SWFMovieClip_nextFrame(mc1);
+  
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1);  //add movieClip1 to the _root
+  SWFDisplayItem_setDepth(it1, 3);
+  SWFDisplayItem_setName(it1, "movieClip1"); //name movieClip1
+  SWFDisplayItem_addAction(it1, newSWFAction(
+    "_root.note(this+' constructed');"
+    "_root.mc1Constructed++;"
+    ), SWFACTION_CONSTRUCT);
+  SWFDisplayItem_addAction(it1, newSWFAction(
+    "_root.note(this+' unloaded');"
+    "_root.mc1Unloaded++;"
+    ), SWFACTION_UNLOAD);
+
+  check_equals(mo, "typeof(movieClip1)", "'movieclip'");
+  xcheck_equals(mo, "_root.mc1Constructed", "1");
+
+  SWFMovie_nextFrame(mo);  
+
+  // Frame3: Remove red square
+  SWFDisplayItem_remove(it1);
+  xcheck_equals(mo, "typeof(movieClip1)", "'movieclip'"); // kept alive for 
calling onUnload!
+  check_equals(mo, "_root.mc1Constructed", "1");
+  SWFMovie_nextFrame(mo);  
+  
+  // Frame4: nothing new
+  SWFMovie_nextFrame(mo); 
+  
+  // Frame5: check, gotoAndStop(4), check..
+
+  check_equals(mo, "typeof(movieClip1)", "'undefined'");
+  SWFMovie_add(mo, (SWFBlock)newSWFAction( "gotoAndStop(4);"));
+  xcheck_equals(mo, "typeof(movieClip1)", "'movieclip'");
+
+  // Gnash calls onConstruct again !!
+  xcheck_equals(mo, "_root.mc1Constructed", "2");
+
+  // this is due to action execution order, it's called twice, but
+  // the second time it's called *after* the end of *this* DOACTION block ..
+  check_equals(mo, "_root.mc1Unloaded", "1");
+
+  SWFMovie_add(mo, (SWFBlock)newSWFAction( "totals(); stop();" ));
+  SWFMovie_nextFrame(mo);
+
+  //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]