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: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Mon, 08 Oct 2007 06:21:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/10/08 06:21:45

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

Log message:
                * testsuite/misc-ming.all/: Makefile.am, loop_test9.c: test that
                  a PlaceObject-placed instance in a depth higher then 0 (after
                  depth-shift) doesn't get removed on jump-back. Verifies 
behaviour
                  of bug #21281.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4563&r2=1.4564
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.157&r2=1.158
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test9.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4563
retrieving revision 1.4564
diff -u -b -r1.4563 -r1.4564
--- ChangeLog   7 Oct 2007 21:37:15 -0000       1.4563
+++ ChangeLog   8 Oct 2007 06:21:44 -0000       1.4564
@@ -1,4 +1,11 @@
-2007-10-06 Sandro Santilli <address@hidden>
+2007-10-08 Sandro Santilli <address@hidden>
+
+       * testsuite/misc-ming.all/: Makefile.am, loop_test9.c: test that
+         a PlaceObject-placed instance in a depth higher then 0 (after
+         depth-shift) doesn't get removed on jump-back. Verifies behaviour
+         of bug #21281.
+
+2007-10-07 Sandro Santilli <address@hidden>
 
        * server/swf/RemoveObjectTag.cpp (loader): don't attempt to unregister
          a timeline depth if depth is out of the static zone. PlaceObject2

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -b -r1.157 -r1.158
--- testsuite/misc-ming.all/Makefile.am 1 Oct 2007 10:03:25 -0000       1.157
+++ testsuite/misc-ming.all/Makefile.am 8 Oct 2007 06:21:45 -0000       1.158
@@ -86,6 +86,7 @@
        loop_test6 \
        loop_test7 \
        loop_test8 \
+       loop_test9 \
        loop_test-Runner \
        place_object_test \
        place_object_test2 \
@@ -246,6 +247,7 @@
        loop_test6runner \
        loop_test7runner \
        loop_test8runner \
+       loop_test9runner \
        shape_testrunner \
        registerClassTest2runner \
        DefineEditTextVariableNameTest-Runner \
@@ -536,6 +538,16 @@
        sh $< -f20 $(top_builddir) loop_test8.swf > $@
        chmod 755 $@
        
+loop_test9_SOURCES = loop_test9.c
+loop_test9_LDADD = libgnashmingutils.la
+
+loop_test9.swf: loop_test9
+       ./loop_test9 $(top_srcdir)/testsuite/media
+
+loop_test9runner: $(srcdir)/../generic-testrunner.sh loop_test9.swf Makefile
+       sh $< -r10 -f20 -c "END OF TEST" $(top_builddir) loop_test9.swf > $@
+       chmod 755 $@
+       
 shape_test_SOURCES = shape_test.c
 shape_test_LDADD = libgnashmingutils.la
 
@@ -1765,6 +1777,7 @@
        loop_test6runner \
        loop_test7runner \
        loop_test8runner \
+       loop_test9runner \
        shape_testrunner \
        morph_test1runner \
        registerClassTest2runner \

Index: testsuite/misc-ming.all/loop_test9.c
===================================================================
RCS file: testsuite/misc-ming.all/loop_test9.c
diff -N testsuite/misc-ming.all/loop_test9.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/loop_test9.c        8 Oct 2007 06:21:45 -0000       
1.1
@@ -0,0 +1,158 @@
+/* 
+ *   Copyright (C) 2005, 2006 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 3 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 start of two character's lifetime after depth 
swap"
+ *
+ * Timeline:
+ * 
+ *   Frame  | 1 | 2 | 3 | 4 | 
+ *  --------+---+---+---+---+
+ *   Event  | * |PP |   | J |
+ * 
+ *  P = place (by PlaceObject2)
+ *  M = move to another depth (by swapDepth)
+ *  J = jump
+ *  * = jump target
+ *
+ * Description:
+ *
+ *  frame2: two static characters are placed, both by PlaceObject2,
+ *          one in the static zone, one in the dynamic zone
+ *  frame4: jump to frame 1 and stop.
+ *
+ * Expected behaviour:
+ *
+ * The static characters placed out of the static depth zone
+ * get NOT removed on jump back. 
+ *
+ * run as ./loop_test9
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "loop_test9.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip mc1, mc2, dejagnuclip;
+  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, 2);
+
+  // Frame 1: Place dejagnu clip
+
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  SWFMovie_nextFrame(mo); 
+
+  // Frame 2: Place two static characters
+
+  sh1 = make_fill_square (300, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+  mc1 = newSWFMovieClip();
+  SWFMovieClip_add(mc1, (SWFBlock)sh1); 
+  SWFMovieClip_nextFrame(mc1);
+  
+  sh2 = make_fill_square (330, 270, 120, 120, 0, 0, 0, 0, 0, 0);
+  mc2 = newSWFMovieClip();
+  SWFMovieClip_add(mc2, (SWFBlock)sh2);  
+  SWFMovieClip_nextFrame(mc2); 
+
+  SWFDisplayItem it1, it2;
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1);  //add movieClip1 to the _root
+  SWFDisplayItem_setName(it1, "movieClip1"); //name movieClip1
+  SWFDisplayItem_addAction(it1, newSWFAction(
+               "_root.note(this+' constructed');"
+               "_root.mc1Constructed++;"
+               ), SWFACTION_CONSTRUCT);
+  SWFDisplayItem_setDepth(it1, 3); // depth of movieClip1 is 3 (-16381)
+
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2);  //add movieClip2 to the _root
+  SWFDisplayItem_setName(it2, "movieClip2"); //name movieClip2
+  SWFDisplayItem_addAction(it2, newSWFAction(
+               "_root.note(this+' constructed');"
+               "_root.mc2Constructed++;"),
+                 SWFACTION_CONSTRUCT);
+  SWFDisplayItem_setDepth(it2, 30000); // depth of movieClip2 is 30000 (13616)
+  
+  SWFMovie_nextFrame(mo);
+  
+  // Frame3: gotoAndStop(2), check..
+
+  SWFMovie_add(mo, (SWFBlock)newSWFAction(
+
+      "var mc1_depth = movieClip1.getDepth();"
+      "var mc2_depth = movieClip2.getDepth();"
+      "movieClip1.secretCode = 'mc1';"
+      "movieClip2.secretCode = 'mc2';"
+
+      "check_equals(movieClip1.getDepth(), -16381);" 
+      "check_equals(movieClip2.getDepth(), 13616);"
+
+      "gotoAndStop(1);"
+
+      // MC1 (in static depth zone) has been removed
+      "check_equals(typeof(movieClip1), 'undefined');"
+      // MC2 (in dynamic depth zone) has been kept
+      "check_equals(typeof(movieClip2), 'movieclip');"
+
+      // The kept instance wasn't detroyed
+      "check_equals(movieClip2.secretCode, 'mc2');"
+
+      // Both chars have been constructed once (consistency check)
+      "check_equals(mc1Constructed, 1);"
+      "check_equals(mc2Constructed, 1);"
+
+      "totals(7);"
+
+      "trace('END OF TEST');"
+
+       ));
+  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]