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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/replace...
Date: Wed, 23 May 2007 15:54:31 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/23 15:54:31

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: replace_shapes1test.c 
                                 replace_sprites1test.c 

Log message:
                * testsuite/misc-ming.all/: replace_shapes1test.c,
                  replace_sprites1test.c: Fix implementation (don't
                  use Ming internal methods); add new tests and comments
                  about why Gnash fails.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3316&r2=1.3317
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/replace_shapes1test.c?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/replace_sprites1test.c?cvsroot=gnash&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3316
retrieving revision 1.3317
diff -u -b -r1.3316 -r1.3317
--- ChangeLog   23 May 2007 13:59:31 -0000      1.3316
+++ ChangeLog   23 May 2007 15:54:30 -0000      1.3317
@@ -1,3 +1,10 @@
+2007-05-23 Sandro Santilli <address@hidden>
+
+       * testsuite/misc-ming.all/: replace_shapes1test.c,
+         replace_sprites1test.c: Fix implementation (don't
+         use Ming internal methods); add new tests and comments
+         about why Gnash fails.
+
 2007-05-23 Bastiaan Jacques <address@hidden>
 
        * cygnal/cygnal.cpp: Don't include <libintl.h> directly; instead,

Index: testsuite/misc-ming.all/replace_shapes1test.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/replace_shapes1test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/misc-ming.all/replace_shapes1test.c       22 May 2007 18:20:03 
-0000      1.1
+++ testsuite/misc-ming.all/replace_shapes1test.c       23 May 2007 15:54:31 
-0000      1.2
@@ -58,6 +58,7 @@
 
 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
 get_shape(int width, int height, int r, int g, int b)
@@ -106,8 +107,7 @@
   SWFMovie mo;
   SWFMovieClip dejagnuclip;
   SWFShape static1, static2;
-  int i;
-  SWFDisplayItem it1, it2;
+  SWFDisplayItem it1;
 
 
   const char *srcdir=".";
@@ -147,13 +147,23 @@
                        " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
                        ), SWFACTION_CONSTRUCT);
   add_actions(mo, "static1.name='static1';"); 
+  xcheck_equals(mo, "typeof(static1)", "'movieclip'"); 
+
+  // Gnash allows custom members to shape characters...
+  // this is important to verify, see next check for it after REPLACE
+  check_equals(mo, "static1.name", "'static1'");
+
+  xcheck_equals(mo, "static1._target", "'/'");
   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(
+  if ( ! SWFMovie_replace(mo, it1, (SWFBlock)static2) )
+  {
+         abort(); // grace and beauty...
+  }
+  SWFDisplayItem_moveTo(it1, 110, 110);
+  SWFDisplayItem_setName(it1, "static2");
+  SWFDisplayItem_addAction(it1, newSWFAction(
                        "_root.note(this+' onClipConstruct');"
                        " _root.check_equals(typeof(_root), 'movieclip');"
                        " if ( isNaN(_root.depth3Constructed) ) {"
@@ -168,10 +178,14 @@
   // Can still reference the old character and it's variables, after replace
   xcheck_equals(mo, "typeof(static1)", "'movieclip'"); 
   xcheck_equals(mo, "static1.name", "'static1'");
+  xcheck_equals(mo, "static1._target", "'/'");
 
-  // While we can NOT reference the new character by name
+  // While the new name results undefined...
   xcheck_equals(mo, "typeof(static2)", "'undefined'"); // the name wasn't 
changed
 
+  // Everything suggests that a new instance is NOT created on replace !!!
+  // Gnash here fails because it creates a NEW instance
+
   // 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

Index: testsuite/misc-ming.all/replace_sprites1test.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/replace_sprites1test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/replace_sprites1test.c      22 May 2007 19:05:20 
-0000      1.2
+++ testsuite/misc-ming.all/replace_sprites1test.c      23 May 2007 15:54:31 
-0000      1.3
@@ -58,6 +58,7 @@
 
 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
 get_shape(int width, int height, int r, int g, int b)
@@ -105,9 +106,8 @@
 {
   SWFMovie mo;
   SWFMovieClip dejagnuclip;
-  SWFShape static1, static2;
-  int i;
-  SWFDisplayItem it1, it2;
+  SWFMovieClip static1, static2;
+  SWFDisplayItem it1;
 
 
   const char *srcdir=".";
@@ -147,13 +147,24 @@
                        " _root.note('_root.depth3Constructed set to 
'+_root.depth3Constructed);"
                        ), SWFACTION_CONSTRUCT);
   add_actions(mo, "static1.name='static1';"); 
+
+  check_equals(mo, "typeof(static1)", "'movieclip'"); 
+
+  // This is important to verify, see next check for it after REPLACE
+  check_equals(mo, "static1.name", "'static1'");
+
+  check_equals(mo, "static1._target", "'/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(
+  if ( ! SWFMovie_replace(mo, it1, (SWFBlock)static2) )
+  {
+         abort(); // grace and beauty...
+  }
+  SWFDisplayItem_moveTo(it1, 110, 110);
+  SWFDisplayItem_setName(it1, "static2");
+  SWFDisplayItem_addAction(it1, newSWFAction(
                        "_root.note(this+' onClipConstruct');"
                        " _root.check_equals(typeof(_root), 'movieclip');"
                        " if ( isNaN(_root.depth3Constructed) ) {"
@@ -168,9 +179,13 @@
   // Can still reference the old character and it's variables, after replace
   xcheck_equals(mo, "typeof(static1)", "'movieclip'"); 
   xcheck_equals(mo, "static1.name", "'static1'");
+  xcheck_equals(mo, "static1._target", "'/static1'");
+
+  // While the new name results undefined...
+  xcheck_equals(mo, "typeof(static2)", "'undefined'"); 
 
-  // While we can NOT reference the new character by name
-  xcheck_equals(mo, "typeof(static2)", "'undefined'"); // the name wasn't 
changed
+  // Everything suggests that a new instance is NOT created on replace !!!
+  // Gnash here fails because it creates a NEW instance
 
   // Anyway, the old character matrix changed to 110,110 !
   xcheck_equals(mo, "static1._x", "110");




reply via email to

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