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: Wed, 18 Apr 2007 08:13:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/04/18 08:13:45

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

Log message:
        new testcase for duplicateMovieClip(), user defined events should not 
be duplicated

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2902&r2=1.2903
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/duplicate_movie_clip_test.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2902
retrieving revision 1.2903
diff -u -b -r1.2902 -r1.2903
--- ChangeLog   18 Apr 2007 07:17:11 -0000      1.2902
+++ ChangeLog   18 Apr 2007 08:13:45 -0000      1.2903
@@ -9,6 +9,8 @@
 
        * testsuite/misc-ming.all/Makefile.am:
          activate testcast path_format_test.c
+       * testsuite/misc-ming.all/duplicate_movie_clip_test.c
+         new testcase for duplicateMovieClip().
          
 2007-04-17 Sandro Santilli <address@hidden>
 

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- testsuite/misc-ming.all/Makefile.am 18 Apr 2007 03:34:16 -0000      1.94
+++ testsuite/misc-ming.all/Makefile.am 18 Apr 2007 08:13:45 -0000      1.95
@@ -107,6 +107,7 @@
        get_frame_number_test \
        frame_label_test \
        path_format_test \
+       duplicate_movie_clip_test \
        $(NULL)
 
 if MAKESWF_SUPPORTS_PREBUILT_CLIPS
@@ -144,6 +145,7 @@
        get_frame_number_testrunner \
        frame_label_testrunner \
        path_format_testrunner \
+       duplicate_movie_clip_testrunner \
        matrix_testrunner \
        $(NULL)
 
@@ -433,6 +435,20 @@
        sh $< -r5 $(top_builddir) path_format_test.swf > $@
        chmod 755 $@
 
+duplicate_movie_clip_test_SOURCES =    \
+       duplicate_movie_clip_test.c     \
+       ming_utils.h            \
+       ming_utils.c            \
+       $(NULL)
+duplicate_movie_clip_test_LDADD = $(MING_LIBS)
+
+duplicate_movie_clip_test.swf: duplicate_movie_clip_test
+       ./duplicate_movie_clip_test $(top_srcdir)/testsuite/media
+
+duplicate_movie_clip_testrunner: $(srcdir)/../generic-testrunner.sh 
duplicate_movie_clip_test.swf
+       sh $< -r5 $(top_builddir) duplicate_movie_clip_test.swf > $@
+       chmod 755 $@
+       
 attachMovieTest_SOURCES =      \
        attachMovieTest.c       \
        ming_utils.h            \
@@ -943,6 +959,7 @@
        get_frame_number_testrunner \
        frame_label_testrunner \
        path_format_testrunner \
+       duplicate_movie_clip_testrunner \
        $(NULL)
 
 if MAKESWF_SUPPORTS_PREBUILT_CLIPS

Index: testsuite/misc-ming.all/duplicate_movie_clip_test.c
===================================================================
RCS file: testsuite/misc-ming.all/duplicate_movie_clip_test.c
diff -N testsuite/misc-ming.all/duplicate_movie_clip_test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/duplicate_movie_clip_test.c 18 Apr 2007 08:13:45 
-0000      1.1
@@ -0,0 +1,93 @@
+/*
+ *   Copyright (C) 2005, 2006, 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
+ *
+ */ 
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION  6
+#define OUTPUT_FILENAME  "duplicate_movie_clip_test.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc, dejagnuclip;
+  SWFDisplayItem it;
+  SWFShape  sh_red;
+
+  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, 12.0);
+
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, "x1=0; x2=0; x3=0;");
+  SWFMovie_nextFrame(mo); 
+
+  
+  mc = newSWFMovieClip();
+  sh_red = make_fill_square (100, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+  SWFMovieClip_add(mc, (SWFBlock)sh_red);  
+  add_clip_actions(mc, "stop();");
+  SWFMovieClip_nextFrame(mc);
+
+
+  it = SWFMovie_add(mo, (SWFBlock)mc); 
+  SWFDisplayItem_setDepth(it, 10); 
+  SWFDisplayItem_setName(it, "mc"); 
+  
+  add_actions(mo, " mc.onLoad = function () {};"
+                  " mc.prop1 = 10; "
+                  " duplicateMovieClip('mc', 'dup', 1); ");
+  SWFMovie_nextFrame(mo); 
+  
+  
+  check_equals(mo, "mc.prop1", "10");
+  check_equals(mo, "typeof(mc.onLoad)", "'function'");
+  check_equals(mo, "mc.getDepth()", "-16374");
+  check_equals(mo, "dup.prop1", "undefined");  // user defined property will 
not be duplicated
+  xcheck_equals(mo, "typeof(dup.onLoad)", "'undefined'"); //user defined event 
will not be duplicated
+  check_equals(mo, "dup.getDepth()", "1");
+  add_actions(mo, " _root.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]