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: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Tue, 09 Oct 2007 09:06:27 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/10/09 09:06:27

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

Log message:
        * testsuite/misc-ming.all/PlaceObject2Test.swf, Makefile.am: enable an 
old
          testcase, it wasn't used actually. Test DLIST tags with dynamic depth 
manipulation.
          All passed with cvs-head.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4573&r2=1.4574
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.159&r2=1.160
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/PlaceObject2Test.c?cvsroot=gnash&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4573
retrieving revision 1.4574
diff -u -b -r1.4573 -r1.4574
--- ChangeLog   9 Oct 2007 08:12:25 -0000       1.4573
+++ ChangeLog   9 Oct 2007 09:06:26 -0000       1.4574
@@ -1,3 +1,9 @@
+2007-10-09 Zou Lunkai <address@hidden>
+       
+       * testsuite/misc-ming.all/PlaceObject2Test.swf, Makefile.am: enable an 
old
+         testcase, it wasn't used actually. Test DLIST tags with dynamic depth 
manipulation.
+         All passed with cvs-head.
+         
 2007-10-09 Sandro Santilli <address@hidden>
 
        * server/vm/ActionExec.cpp (call operator): don't execute anything

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -b -r1.159 -r1.160
--- testsuite/misc-ming.all/Makefile.am 8 Oct 2007 06:33:54 -0000       1.159
+++ testsuite/misc-ming.all/Makefile.am 9 Oct 2007 09:06:26 -0000       1.160
@@ -198,6 +198,7 @@
        timeline_var_test-Runner \
        place_object_testrunner \
        place_object_test2runner \
+       PlaceObject2TestRunner \
        move_object_testrunner \
        place_and_remove_object_testrunner \
        place_and_remove_object_insane_testrunner \
@@ -352,6 +353,13 @@
        $(NULL)
 PlaceObject2Test_LDADD = libgnashmingutils.la
 
+PlaceObject2Test.swf: PlaceObject2Test
+       ./PlaceObject2Test $(top_srcdir)/testsuite/media
+
+PlaceObject2TestRunner: $(srcdir)/../generic-testrunner.sh PlaceObject2Test.swf
+       sh $< -r5 $(top_builddir) PlaceObject2Test.swf > $@
+       chmod 755 $@
+
 RemoveObject2Test_SOURCES = RemoveObject2Test.c
 RemoveObject2Test_LDADD = libgnashmingutils.la
 
@@ -1711,6 +1719,7 @@
        loop_test-Runner \
        place_object_testrunner \
        place_object_test2runner \
+       PlaceObject2TestRunner \
        move_object_testrunner \
        place_and_remove_object_testrunner \
        place_and_remove_object_insane_testrunner \

Index: testsuite/misc-ming.all/PlaceObject2Test.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/PlaceObject2Test.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- testsuite/misc-ming.all/PlaceObject2Test.c  1 Jul 2007 10:54:47 -0000       
1.7
+++ testsuite/misc-ming.all/PlaceObject2Test.c  9 Oct 2007 09:06:26 -0000       
1.8
@@ -17,71 +17,119 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  *
- ***********************************************************************
+/*
+ * Test DLIST tags with dynamic depth zone specified
  *
- * Test case for the PlaceObject2 tag
- * It places two squares at two different depths with two different
- * names, then places a third at depth of one and with name of the
- * other.
+ * Timeline:
  *
- ***********************************************************************/
+ *   Frame  | 1 | 2 | 3 | 4 | 
+ *  --------+---+---+---+---+
+ *   Event  |   |PP |TT | RR|
+ * 
+ *  P = place (by PlaceObject2)
+ *  T = transform (by PlaceObject2 tag)
+ *  R = remove(by RemoveObject2 tag)
+ *
+ * Description:
+ *
+ *  frame2: two static sprites are placed, both by PlaceObject2,
+ *          one in depth 16384(0), one in depth 65535(49151)
+ *  frame3: transform the sprites by PlaceObject2 tag
+ *  frame4: remove the two sprites by RemoveObject2 tag
+ *  frame5: place shape1 at depth 16384(0), shape2 at depth 65535(49151).
+ *  frame6: replace shape1 with shape2
+ *
+ * Expected behaviour:
+ *  DLIST tags manipulate characters in dynamic zone as in static zone in this 
test.
+ *
+ * run as ./PlaceObject2Test
+ */
 
 #include "ming_utils.h"
 
 #include <stdio.h>
 #include <ming.h>
 
-#define OUTPUT_VERSION 6
+#define OUTPUT_VERSION 7
 #define OUTPUT_FILENAME "PlaceObject2Test.swf"
 
 int
-main()
+main(int argc, char** argv) 
 {
        SWFMovie mo;
-       SWFDisplayItem it;
-       SWFShape sh;
-
-       /*********************************************
-        *
-        * Initialization
-        *
-        *********************************************/
-
-       puts("Setting things up");
+  SWFMovieClip mc1, mc2, dejagnuclip;
+  SWFDisplayItem it1, it2;
+  SWFShape  sh1,sh2;
+  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);
-       Ming_setScale(20.0); 
  
        mo = newSWFMovie();
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate(mo, 6);
 
-       /*****************************************************
-        *
-        * Add the square named 
-        *
-        *****************************************************/
-
-       SWFMovie_setDimension(mo, 100, 100);
-
-       sh = make_square(10, 10, 20, 20, 255, 0, 0);
-       it = SWFMovie_add(mo, (SWFBlock)sh);
-       SWFDisplayItem_setDepth(it, 1);
-       SWFDisplayItem_setName(it, "Name1");
-
-       sh = make_square(35, 10, 20, 20, 0, 255, 0);
-       it = SWFMovie_add(mo, (SWFBlock)sh);
-       SWFDisplayItem_setDepth(it, 2);
-       SWFDisplayItem_setName(it, "Name2");
-
-       sh = make_square(10, 35, 45, 20, 0, 0, 255);
-       it = SWFMovie_add(mo, (SWFBlock)sh);
-       SWFDisplayItem_setDepth(it, 1);
-       SWFDisplayItem_setName(it, "Name2");
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  SWFMovie_nextFrame(mo);  // frame 1
+  
+  
+  mc1 = newSWFMovieClip();
+  mc2 = newSWFMovieClip();
+  
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1);  //add movieClip1 to _root
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2);  //add movieClip2 to _root
+  SWFDisplayItem_setName(it1, "Mc1");
+  SWFDisplayItem_setName(it2, "Mc2");
+  // place 2 sprites characters at dynamic zone
+  SWFDisplayItem_setDepth(it1, 16384);
+  SWFDisplayItem_setDepth(it2, 65535);
+  
+  check_equals(mo, "Mc1.getDepth()", "0");
+  check_equals(mo, "Mc2.getDepth()", "49151");
+  SWFMovie_nextFrame(mo); // frame 2
+ 
+  // move sprites at dynamic zone
+  SWFDisplayItem_move(it1, 0,   100);
+  SWFDisplayItem_move(it2, 100, 200);
+  check_equals(mo, "Mc1._y", "100");
+  check_equals(mo, "Mc2._y", "200");
+  SWFMovie_nextFrame(mo); // frame 3
+  
+  // remove sprites at dynamic zone
+  SWFDisplayItem_remove(it1);
+  SWFDisplayItem_remove(it2);
+  check_equals(mo, "Mc1", "undefined");
+  check_equals(mo, "Mc2", "undefined");
+  SWFMovie_nextFrame(mo); // frame 4
+  
+  // place a shape at dynamic zone
+  sh1 = make_fill_square (100, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+  sh2 = make_fill_square (300, 300, 60, 60, 0, 255, 0, 0, 255, 0);
+  it1 = SWFMovie_add(mo, (SWFBlock)sh1);
+  it2 = SWFMovie_add(mo, (SWFBlock)sh2);
+  SWFDisplayItem_setDepth(it1, 16384);
+  SWFDisplayItem_setDepth(it2, 65535);
+  SWFMovie_nextFrame(mo); // frame 5
+  
+  // replace the shape with another one
+  if ( SWFMovie_replace(mo, it1, (SWFBlock)sh2) )
+  {
+    abort(); 
+  }
+  SWFMovie_nextFrame(mo); // frame 6
 
+  add_actions(mo, "totals(6); stop();");
+  SWFMovie_nextFrame(mo); // frame 6
        puts("Saving " OUTPUT_FILENAME );
-
-       SWFMovie_nextFrame(mo); /* showFrame */
-
        SWFMovie_save(mo, OUTPUT_FILENAME);
 
        return 0;




reply via email to

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