gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash configure.ac testsuite/misc-ming.all/Make...


From: Sandro Santilli
Subject: [Gnash-commit] gnash configure.ac testsuite/misc-ming.all/Make...
Date: Tue, 22 May 2007 18:20:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/22 18:20:03

Modified files:
        .              : configure.ac 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: replace_shapes1test.c 
                                 replace_sprites1test.c 

Log message:
                * configure.ac: add MING_SUPPORTS_REPLACE conditinal variable,
                  based on version (0.4.0.beta5) but currently disabled due
                  to SF bugs preventing latest klaus commit to succeed :(
                * testsuite/misc-ming.all/: Makefile.am, replace_shapes1test.c,
                  replace_sprites1test.c: Add a couple of test for REPLACE tags.
                  Needs a Ming version that supports it, checked by
                  MING_SUPPORTS_REPLACE as set by ./configure.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.319&r2=1.320
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.123&r2=1.124
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/replace_shapes1test.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/replace_sprites1test.c?cvsroot=gnash&rev=1.1

Patches:
Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.319
retrieving revision 1.320
diff -u -b -r1.319 -r1.320
--- configure.ac        18 May 2007 19:39:20 -0000      1.319
+++ configure.ac        22 May 2007 18:20:02 -0000      1.320
@@ -15,7 +15,7 @@
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 dnl  
 
-dnl $Id: configure.ac,v 1.319 2007/05/18 19:39:20 martinwguy Exp $
+dnl $Id: configure.ac,v 1.320 2007/05/22 18:20:02 strk Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, cvs)
@@ -669,6 +669,13 @@
 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
         [ test x"$MAKESWF" != x && test $MING_VERSION_CODE -ge 00040004  ])
 
+dnl
+dnl Temporarly disabled due to SF problems preventing Ming HEAD to be fully
+dnl supporting this...
+dnl
+AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
+        [ test x"$MAKESWF" != x && test $MING_VERSION_CODE -ge 00040005 && 
false ])
+
 AC_ARG_WITH([swfdec_testsuite],
        AC_HELP_STRING([--with-swfdec-testsuite],
                [directory where swfdec testsuite (the 'test' dir) is]),

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- testsuite/misc-ming.all/Makefile.am 21 May 2007 17:52:28 -0000      1.123
+++ testsuite/misc-ming.all/Makefile.am 22 May 2007 18:20:03 -0000      1.124
@@ -154,6 +154,13 @@
        $(NULL)
 endif
 
+if MING_SUPPORTS_REPLACE_TAG
+check_PROGRAMS += \
+       replace_shapes1test \
+       replace_sprites1test \
+       $(NULL)
+endif
+
 check_SCRIPTS = \
        timeline_var_test-Runner \
        place_object_testrunner \
@@ -214,6 +221,13 @@
        $(NULL)
 endif
 
+if MING_SUPPORTS_REPLACE_TAG
+check_SCRIPTS += \
+       replace_shapes1test_runner \
+       replace_sprites1test_runner \
+       $(NULL)
+endif
+
 
 # TESTS = \
 #      DefineEditTextVariableNameTest-Runner 
@@ -569,6 +583,26 @@
        sh $< -f20 $(top_builddir) displaylist_depths_test11.swf > $@
        chmod 755 $@
 
+replace_shapes1test_SOURCES = replace_shapes1test.c    
+replace_shapes1test_LDADD = libgnashmingutils.la
+
+replace_shapes1test.swf: replace_shapes1test
+       ./replace_shapes1test $(top_srcdir)/testsuite/media
+
+replace_shapes1test_runner: $(srcdir)/../generic-testrunner.sh 
replace_shapes1test.swf
+       sh $< -f20 $(top_builddir) replace_shapes1test.swf > $@
+       chmod 755 $@
+
+replace_sprites1test_SOURCES = replace_sprites1test.c  
+replace_sprites1test_LDADD = libgnashmingutils.la
+
+replace_sprites1test.swf: replace_sprites1test
+       ./replace_sprites1test $(top_srcdir)/testsuite/media
+
+replace_sprites1test_runner: $(srcdir)/../generic-testrunner.sh 
replace_sprites1test.swf
+       sh $< -f20 $(top_builddir) replace_sprites1test.swf > $@
+       chmod 755 $@
+
 masks_test_SOURCES =   \
        masks_test.c    \
        $(NULL)
@@ -1339,6 +1373,13 @@
        $(NULL)
 endif
 
+if MING_SUPPORTS_REPLACE_TAG
+TEST_CASES += \
+       replace_shapes1test_runner \
+       replace_sprites1test_runner \
+       $(NULL)
+endif
+
 check-DEJAGNU: site-update $(check_PROGRAMS)
        @runtest=$(RUNTEST); \
        if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \

Index: testsuite/misc-ming.all/replace_shapes1test.c
===================================================================
RCS file: testsuite/misc-ming.all/replace_shapes1test.c
diff -N testsuite/misc-ming.all/replace_shapes1test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/replace_shapes1test.c       22 May 2007 18:20:03 
-0000      1.1
@@ -0,0 +1,213 @@
+/* 
+ *   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
+ *
+ */ 
+
+/*
+ * Sandro Santilli, address@hidden
+ *
+ * Test  "Jump backward to start of lifetime after replacement with different 
shape"
+ *
+ * run as ./replace_shapes1test
+ *
+ * Timeline:
+ * 
+ *   Frame  | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+ *  --------+---+---+---+---+---+---+---+
+ *   Event  |   |P* | X | J |   |   |   |
+ * 
+ *  P = place (by PlaceObject2)
+ *  X = replace (by PlaceObject2)
+ *  J = jump
+ *  * = jump target
+ * 
+ * Description:
+ * 
+ *  frame2: shape 1 placed at depth -16381 and position 100,100
+ *  frame3: instance at depth -16381 replaced by character 2 at position 
110,110
+ *  frame4: jump back to frame 2 and stop
+ * 
+ * Expected behaviour:
+ * 
+ *  A single instances have been constructed in total.
+ *  The instance contains a red shape at (100,100) initially, a green shape
+ *  at (110,110) after the replace, a red shape at (100,100) again on 
loop-back.
+ */
+
+#include "ming_utils.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "replace_shapes1test.swf"
+
+SWFDisplayItem add_static_mc(SWFMovie mo, const char* name, int depth, int x, 
int y, int width, int height);
+SWFMovieClip get_static_mc(int width, int height, int r, int g, int b);
+
+SWFShape
+get_shape(int width, int height, int r, int g, int b)
+{
+  SWFShape sh;
+
+  sh = make_fill_square (-(width/2), -(height/2), width, height, r, g, b, r, 
g, b);
+
+  return sh;
+}
+
+SWFMovieClip
+get_static_mc(int width, int height, int r, int g, int b)
+{
+  SWFShape sh = get_shape(width, height, r, g, b);
+  SWFMovieClip mc = newSWFMovieClip();
+
+  SWFMovieClip_add(mc, (SWFBlock)sh);
+
+  SWFMovieClip_nextFrame(mc);
+
+  return mc;
+
+}
+
+SWFDisplayItem
+add_static_mc(SWFMovie mo, const char* name, int depth, int x, int y, int 
width, int height)
+{
+  SWFMovieClip mc;
+  SWFDisplayItem it;
+
+  mc = get_static_mc(width, height, 255, 0, 0);
+
+  it = SWFMovie_add(mo, (SWFBlock)mc);
+  SWFDisplayItem_setDepth(it, depth); 
+  SWFDisplayItem_moveTo(it, x, y); 
+  SWFDisplayItem_setName(it, name);
+
+  return it;
+}
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip dejagnuclip;
+  SWFShape static1, static2;
+  int i;
+  SWFDisplayItem it1, it2;
+
+
+  const char *srcdir=".";
+  if ( argc>1 ) 
+    srcdir=argv[1];
+  else
+  {
+      //fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+      //return 1;
+  }
+
+  Ming_init();
+  mo = newSWFMovieWithVersion(OUTPUT_VERSION);
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate (mo, 2);
+
+  static1 = get_shape(20, 20, 255, 0, 0);
+  static2 = get_shape(20, 20, 0, 255, 0);
+
+  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 character at depth 3 (-16381)
+  it1 = SWFMovie_add(mo, (SWFBlock)static1);
+  SWFDisplayItem_setDepth(it1, 3);
+  SWFDisplayItem_moveTo(it1, 100, 100);
+  SWFDisplayItem_setName(it1, "static1");
+  SWFDisplayItem_addAction(it1, newSWFAction(
+                       "_root.note(this+' onClipConstruct');"
+                       " _root.check_equals(typeof(_root), 'movieclip');"
+                       " if ( isNaN(_root.depth3Constructed) ) {"
+                       "       _root.depth3Constructed=1; "
+                       " } else {"
+                       "       _root.depth3Constructed++;"
+                       " }"
+                       " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
+                       ), SWFACTION_CONSTRUCT);
+  add_actions(mo, "static1.name='static1';"); 
+  SWFMovie_nextFrame(mo); 
+
+  // Frame 3: replace instance at depth -16381 with character 2
+  it2 = SWFDisplayItem_replace(it1, (SWFBlock)static2);
+  SWFDisplayItem_moveTo(it2, 110, 110);
+  SWFDisplayItem_setName(it2, "static2");
+  SWFDisplayItem_addAction(it2, newSWFAction(
+                       "_root.note(this+' onClipConstruct');"
+                       " _root.check_equals(typeof(_root), 'movieclip');"
+                       " if ( isNaN(_root.depth3Constructed) ) {"
+                       "       _root.depth3Constructed=1; "
+                       " } else {"
+                       "       _root.depth3Constructed++;"
+                       " }"
+                       " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
+                       ), SWFACTION_CONSTRUCT);
+
+
+  // Can still reference the old character and it's variables, after replace
+  xcheck_equals(mo, "typeof(static1)", "'movieclip'"); 
+  xcheck_equals(mo, "static1.name", "'static1'");
+
+  // While we can NOT reference the new character by name
+  xcheck_equals(mo, "typeof(static2)", "'undefined'"); // the name wasn't 
changed
+
+  // We can't check the color or the _x in a self-contained testcase 
unfortunately,
+  // we'll need a MovieTester-based runner for this.
+  // It is expected the color of the current instane is GREEN, and the 
boundaries
+  // are from 110 to 130 for both X and Y.
+  // TODO: implement a MovieTester based runner !!
+
+  SWFMovie_nextFrame(mo); 
+ 
+  // Frame 4: jump to frame 2, stop and check
+
+  add_actions(mo,
+
+    "gotoAndStop(2); " 
+
+    // Shapes don't get their onConstruct event invoked !
+    "check_equals(typeof(_root.depth3Constructed), 'undefined');"
+
+    // Original character name is still referenceable
+    "xcheck_equals(typeof(static1), 'movieclip');"
+
+    // And it still has it's user-provided property
+    "xcheck_equals(static1.name, 'static1');"
+
+    // We can't check the color or the _x in a self-contained testcase 
unfortunately,
+    // we'll need a MovieTester-based runner for this.
+    // It is expected the color of the current instance is RED, and the 
boundaries
+    // are from 100 to 120 for both X and Y.
+    // TODO: implement a MovieTester based runner !!
+
+    "totals();"
+    );
+  SWFMovie_nextFrame(mo); 
+
+  //Output movie
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}

Index: testsuite/misc-ming.all/replace_sprites1test.c
===================================================================
RCS file: testsuite/misc-ming.all/replace_sprites1test.c
diff -N testsuite/misc-ming.all/replace_sprites1test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/replace_sprites1test.c      22 May 2007 18:20:03 
-0000      1.1
@@ -0,0 +1,217 @@
+/* 
+ *   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
+ *
+ */ 
+
+/*
+ * Sandro Santilli, address@hidden
+ *
+ * Test  "Jump backward to start of lifetime after replacement with different 
sprite"
+ *
+ * run as ./replace_sprites1test
+ *
+ * Timeline:
+ * 
+ *   Frame  | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+ *  --------+---+---+---+---+---+---+---+
+ *   Event  |   |P* | X | J |   |   |   |
+ * 
+ *  P = place (by PlaceObject2)
+ *  X = replace (by PlaceObject2)
+ *  J = jump
+ *  * = jump target
+ * 
+ * Description:
+ * 
+ *  frame2: movieclip 1 placed at depth -16381 and position 100,100
+ *  frame3: instance at depth -16381 replaced by character 2 at position 
110,110
+ *  frame4: jump back to frame 2 and stop
+ * 
+ * Expected behaviour:
+ * 
+ *  A single "movieclip" instances have been constructed in total.
+ *  The instance contains a red shape at (100,100) initially, still a red shape
+ *  at (110,110) after the replace, a red shape at (100,100) again on 
loop-back.
+ */
+
+#include "ming_utils.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "replace_sprites1test.swf"
+
+SWFDisplayItem add_static_mc(SWFMovie mo, const char* name, int depth, int x, 
int y, int width, int height);
+SWFMovieClip get_static_mc(int width, int height, int r, int g, int b);
+
+SWFShape
+get_shape(int width, int height, int r, int g, int b)
+{
+  SWFShape sh;
+
+  sh = make_fill_square (-(width/2), -(height/2), width, height, r, g, b, r, 
g, b);
+
+  return sh;
+}
+
+SWFMovieClip
+get_static_mc(int width, int height, int r, int g, int b)
+{
+  SWFShape sh = get_shape(width, height, r, g, b);
+  SWFMovieClip mc = newSWFMovieClip();
+
+  SWFMovieClip_add(mc, (SWFBlock)sh);
+
+  SWFMovieClip_nextFrame(mc);
+
+  return mc;
+
+}
+
+SWFDisplayItem
+add_static_mc(SWFMovie mo, const char* name, int depth, int x, int y, int 
width, int height)
+{
+  SWFMovieClip mc;
+  SWFDisplayItem it;
+
+  mc = get_static_mc(width, height, 255, 0, 0);
+
+  it = SWFMovie_add(mo, (SWFBlock)mc);
+  SWFDisplayItem_setDepth(it, depth); 
+  SWFDisplayItem_moveTo(it, x, y); 
+  SWFDisplayItem_setName(it, name);
+
+  return it;
+}
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip dejagnuclip;
+  SWFShape static1, static2;
+  int i;
+  SWFDisplayItem it1, it2;
+
+
+  const char *srcdir=".";
+  if ( argc>1 ) 
+    srcdir=argv[1];
+  else
+  {
+      //fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+      //return 1;
+  }
+
+  Ming_init();
+  mo = newSWFMovieWithVersion(OUTPUT_VERSION);
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate (mo, 2);
+
+  static1 = get_static_mc(20, 20, 255, 0, 0);
+  static2 = get_static_mc(20, 20, 0, 255, 0);
+
+  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 character at depth 3 (-16381)
+  it1 = SWFMovie_add(mo, (SWFBlock)static1);
+  SWFDisplayItem_setDepth(it1, 3);
+  SWFDisplayItem_moveTo(it1, 100, 100);
+  SWFDisplayItem_setName(it1, "static1");
+  SWFDisplayItem_addAction(it1, newSWFAction(
+                       "_root.note(this+' onClipConstruct');"
+                       " _root.check_equals(typeof(_root), 'movieclip');"
+                       " if ( isNaN(_root.depth3Constructed) ) {"
+                       "       _root.depth3Constructed=1; "
+                       " } else {"
+                       "       _root.depth3Constructed++;"
+                       " }"
+                       " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
+                       ), SWFACTION_CONSTRUCT);
+  add_actions(mo, "static1.name='static1';"); 
+  SWFMovie_nextFrame(mo); 
+
+  // Frame 3: replace instance at depth -16381 with character 2
+  it2 = SWFDisplayItem_replace(it1, (SWFBlock)static2);
+  SWFDisplayItem_moveTo(it2, 110, 110);
+  SWFDisplayItem_setName(it2, "static2");
+  SWFDisplayItem_addAction(it2, newSWFAction(
+                       "_root.note(this+' onClipConstruct');"
+                       " _root.check_equals(typeof(_root), 'movieclip');"
+                       " if ( isNaN(_root.depth3Constructed) ) {"
+                       "       _root.depth3Constructed=1; "
+                       " } else {"
+                       "       _root.depth3Constructed++;"
+                       " }"
+                       " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
+                       ), SWFACTION_CONSTRUCT);
+
+
+  // Can still reference the old character and it's variables, after replace
+  xcheck_equals(mo, "typeof(static1)", "'movieclip'"); 
+  xcheck_equals(mo, "static1.name", "'static1'");
+
+  // While we can NOT reference the new character by name
+  xcheck_equals(mo, "typeof(static2)", "'undefined'"); // the name wasn't 
changed
+
+  // Anyway, the old character matrix changed to 110,110 !
+  xcheck_equals(mo, "static1._x", "110");
+
+  // We can't check the color in a self-contained testcase unfortunately,
+  // we'll need a MovieTester-based runner for this.
+  // It is expected the color of the current instance to be RED
+  // TODO: implement a MovieTester based runner !!
+
+  SWFMovie_nextFrame(mo); 
+ 
+  // Frame 4: jump to frame 2, stop and check
+
+  add_actions(mo,
+
+    "gotoAndStop(2); " 
+
+    // A single instance has been constructed !!
+    "check_equals(_root.depth3Constructed, '1');"
+
+    // Original character name is still referenceable
+    "xcheck_equals(typeof(static1), 'movieclip');"
+
+    // And it still has it's user-provided property
+    "xcheck_equals(static1.name, 'static1');"
+
+    // The instance have been moved back to its original position (100,100)
+    "xcheck_equals(static1._x, 100);"
+
+    // We can't check the color in a self-contained testcase unfortunately,
+    // we'll need a MovieTester-based runner for this.
+    // It is expected the color of the current instance to be RED
+    // TODO: implement a MovieTester based runner !!
+
+    "totals();"
+    );
+  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]