[Top][All Lists]
[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: |
Wed, 24 Jan 2007 15:17:28 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/01/24 15:17:28
Modified files:
. : ChangeLog
testsuite/misc-ming.all: Makefile.am
Added files:
testsuite/misc-ming.all: action_execution_order_test.c
attachMovieLoopingTest.c
attachMovieLoopingTestRunner.cpp
Log message:
* testsuite/misc-ming.all/: Makefile.am,
action_execution_order_test.c, attachMovieLoopingTest.c,
attachMovieLoopingTestRunner.cpp:
More tests, with failures (didnt' bother using xcheck as
I'm working on them).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2168&r2=1.2169
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/attachMovieLoopingTest.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2168
retrieving revision 1.2169
diff -u -b -r1.2168 -r1.2169
--- ChangeLog 24 Jan 2007 13:32:39 -0000 1.2168
+++ ChangeLog 24 Jan 2007 15:17:28 -0000 1.2169
@@ -1,5 +1,13 @@
2007-01-24 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/: Makefile.am,
+ action_execution_order_test.c, attachMovieLoopingTest.c,
+ attachMovieLoopingTestRunner.cpp:
+ More tests, with failures (didnt' bother using xcheck as
+ I'm working on them).
+
+2007-01-24 Sandro Santilli <address@hidden>
+
* testsuite/misc-ming.all/place_and_remove_object_insane_test.c:
Last commit fixed a couple of tests in this testcase.
* server/: character.h, sprite_instance.{cpp,h}:
Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- testsuite/misc-ming.all/Makefile.am 24 Jan 2007 10:11:54 -0000 1.55
+++ testsuite/misc-ming.all/Makefile.am 24 Jan 2007 15:17:28 -0000 1.56
@@ -70,9 +70,12 @@
place_and_remove_object_insane_test \
attachMovieTest \
attachMovieTestRunner \
+ attachMovieLoopingTest \
+ attachMovieLoopingTestRunner \
registerClassTest \
registerClassTestRunner \
goto_frame_test \
+ action_execution_order_test \
$(NULL)
check_SCRIPTS = \
@@ -82,6 +85,7 @@
place_and_remove_object_testrunner \
place_and_remove_object_insane_testrunner \
goto_frame_testrunner \
+ action_execution_order_testrunner \
$(NULL)
# TESTS = \
@@ -275,6 +279,31 @@
$(top_builddir)/testsuite/libtestsuite.la \
$(NULL)
+attachMovieLoopingTest_SOURCES = \
+ attachMovieLoopingTest.c \
+ ming_utils.h \
+ ming_utils.c \
+ $(NULL)
+attachMovieLoopingTest_LDADD = $(MING_LIBS)
+
+attachMovieLoopingTest.swf: attachMovieLoopingTest
+ ./attachMovieLoopingTest $(top_srcdir)/testsuite/media
+
+attachMovieLoopingTestRunner_SOURCES = \
+ attachMovieLoopingTestRunner.cpp \
+ $(NULL)
+attachMovieLoopingTestRunner_LDADD = \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+attachMovieLoopingTestRunner_CXXFLAGS = \
+ -DSRCDIR='"$(srcdir)"' \
+ -DTGTDIR='"$(abs_builddir)"' \
+ $(NULL)
+attachMovieLoopingTestRunner_DEPENDENCIES = \
+ attachMovieLoopingTest.swf \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+
goto_frame_test_SOURCES = \
goto_frame_test.c \
ming_utils.h \
@@ -289,6 +318,20 @@
sh $< $(top_builddir) goto_frame_test.swf > $@
chmod 755 $@
+action_execution_order_test_SOURCES = \
+ action_execution_order_test.c \
+ ming_utils.h \
+ ming_utils.c \
+ $(NULL)
+action_execution_order_test_LDADD = $(MING_LIBS)
+
+action_execution_order_test.swf: action_execution_order_test
+ ./action_execution_order_test $(top_srcdir)/testsuite/media
+
+action_execution_order_testrunner: $(srcdir)/../generic-testrunner.sh
action_execution_order_test.swf
+ sh $< $(top_builddir) action_execution_order_test.swf > $@
+ chmod 755 $@
+
registerClassTest_SOURCES = \
registerClassTest.c \
ming_utils.h \
@@ -396,6 +439,7 @@
attachMovieTestRunner \
goto_frame_testrunner \
registerClassTestRunner \
+ action_execution_order_testrunner \
$(NULL)
Index: testsuite/misc-ming.all/action_execution_order_test.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_test.c
diff -N testsuite/misc-ming.all/action_execution_order_test.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_test.c 24 Jan 2007
15:17:28 -0000 1.1
@@ -0,0 +1,99 @@
+/*
+ * 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 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
+ *
+ */
+
+/*
+ * Zou Lunkai, address@hidden
+ *
+ * Test the execution order of actions within different movieClips
+ *
+ * set a variable with a new value under _root, then set it again under anther
movieClip.
+ * the variable will only record the later assignment. Checking the final
result of the
+ * variable will tell us which action(assignment) is executed first.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_test.swf"
+
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ SWFMovieClip mc_red, dejagnuclip;
+ 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);
+
+
+ mc_red = newSWFMovieClip();
+ sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+ SWFMovieClip_add(mc_red, (SWFBlock)sh_red);
+ add_clip_actions(mc_red, " _root.x1 = \"as_in_mc_red\"; ");
+ SWFMovieClip_nextFrame(mc_red);//1st frame
+ add_clip_actions(mc_red, " _root.x2 = \"as_in_mc_red\"; stop(); ");
+ SWFMovieClip_nextFrame(mc_red);//2nd frame
+
+ //add mc_red to _root and name it as "mc_red"
+ SWFDisplayItem it_red;
+ it_red = SWFMovie_add(mo, (SWFBlock)mc_red);
+ SWFDisplayItem_setDepth(it_red, 3);
+ SWFDisplayItem_setName(it_red, "mc_red");
+
+ add_actions(mo, " var x1 = \"as_in_root\"; ");
+ SWFMovie_nextFrame(mo); //1st frame
+ add_actions(mo, " _root.x2 = \"as_in_root\"; ");
+ SWFMovie_nextFrame(mo); //2nd frame
+
+ //checks
+ //at 1st frame, actions in mc_red is executed *after* actions in _root
+ check_equals(mo, "_root.x1", "'as_in_mc_red'");
+ //at 2nd frame, actions in mc_red is executed *before* actions in _root
+ check_equals(mo, "_root.x2", "'as_in_root'");
+ add_actions(mo, " _root.totals(); stop(); ");
+ SWFMovie_nextFrame(mo); //3rd frame
+
+ //Output movie
+ puts("Saving " OUTPUT_FILENAME );
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
+
+
+
Index: testsuite/misc-ming.all/attachMovieLoopingTest.c
===================================================================
RCS file: testsuite/misc-ming.all/attachMovieLoopingTest.c
diff -N testsuite/misc-ming.all/attachMovieLoopingTest.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/attachMovieLoopingTest.c 24 Jan 2007 15:17:28
-0000 1.1
@@ -0,0 +1,134 @@
+/*
+ * 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 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
+ *
+ *
+ */
+
+/*
+ * Test MovieClip.attachMovie().
+ *
+ * Exports a 'redsquare' symbol and then attach it to main timeline 4 times
+ * at depths 70+[0..3] and with xoffset 70*[0..3]
+ * The attachMovie() calls all happen in the same frame, the second one.
+ * It is expected that all of them will persist (not be cleared by loopback).
+ *
+ * run as ./attachMovieLoopingTest
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "attachMovieLoopingTest.swf"
+
+void addRedSquareExport(SWFMovie mo);
+void
+addRedSquareExport(SWFMovie mo)
+{
+ SWFShape sh;
+ SWFMovieClip mc;
+
+ sh = make_fill_square (0, 0, 60, 60, 255, 0, 0, 255, 0, 0);
+ mc = newSWFMovieClip();
+
+ SWFMovieClip_add(mc, (SWFBlock)sh);
+ /* This is here just to turn the clip into an active one */
+ add_clip_actions(mc, "onRollOver = function() {};");
+ SWFMovieClip_nextFrame(mc);
+
+ SWFMovie_addExport(mo, (SWFBlock)mc, "redsquare");
+
+ SWFMovie_writeExports(mo);
+}
+
+int
+main(int argc, char** argv)
+{
+ SWFMovie mo;
+ const char *srcdir=".";
+ SWFMovieClip dejagnuclip;
+
+
+ /*********************************************
+ *
+ * Initialization
+ *
+ *********************************************/
+
+ if ( argc>1 ) srcdir=argv[1];
+ else
+ {
+ fprintf(stderr, "Usage: %s\n", argv[0]);
+ return 1;
+ }
+
+ puts("Setting things up");
+
+ Ming_init();
+ Ming_useSWFVersion (OUTPUT_VERSION);
+ Ming_setScale(20.0); /* let's talk pixels */
+
+ mo = newSWFMovie();
+ SWFMovie_setRate(mo, 12);
+ //SWFMovie_setDimension(mo, 6400, 4000);
+ SWFMovie_setDimension(mo, 640, 400);
+
+ /*********************************************
+ *
+ * Body
+ *
+ *********************************************/
+
+ dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10,
0, 80, 800, 600);
+ SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+
+ addRedSquareExport(mo);
+ /* it seems we need a SHOWFRAME for this to be effective */
+ /* (maybe it's related to loop-back handling ?) */
+ SWFMovie_nextFrame(mo);
+
+ add_actions(mo, "initObj = new Object();");
+
+ add_actions(mo,
+ "if ( counter < 4 ) {"
+ " initObj._x = 70*counter;"
+ " attachMovie('redsquare', "
+ " 'square'+counter, 70+counter, initObj);"
+ " check_equals(this['square'+counter]._x, 70*counter);"
+ " counter++;"
+ "} else {"
+ " totals(); stop();"
+ "}"
+ );
+
+ SWFMovie_nextFrame(mo); /* showFrame */
+
+
+ /*****************************************************
+ *
+ * Output movie
+ *
+ *****************************************************/
+
+ puts("Saving " OUTPUT_FILENAME );
+
+ SWFMovie_save(mo, OUTPUT_FILENAME);
+
+ return 0;
+}
Index: testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
===================================================================
RCS file: testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
diff -N testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp 24 Jan 2007
15:17:28 -0000 1.1
@@ -0,0 +1,107 @@
+/*
+ * 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 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
+ *
+ *
+ */
+
+#define INPUT_FILENAME "attachMovieLoopingTest.swf"
+
+#include "MovieTester.h"
+#include "sprite_instance.h"
+#include "character.h"
+#include "dlist.h"
+#include "container.h"
+#include "log.h"
+
+#include "check.h"
+#include <string>
+#include <cassert>
+
+using namespace gnash;
+using namespace std;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+ string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
+ MovieTester tester(filename);
+
+ gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+ dbglogfile.setVerbosity(1);
+
+ sprite_instance* root = tester.getRootMovie();
+ assert(root);
+
+ check_equals(root->get_frame_count(), 2);
+ check_equals(root->get_play_state(), sprite_instance::PLAY);
+ check_equals(root->get_current_frame(), 0);
+
+ check(! tester.findDisplayItemByDepth(*root, 70) );
+ check(! tester.findDisplayItemByDepth(*root, 71) );
+ check(! tester.findDisplayItemByDepth(*root, 72) );
+ check(! tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(30, 30);
+ check(!tester.isMouseOverMouseEntity());
+
+ tester.advance();
+
+ check(tester.findDisplayItemByDepth(*root, 70) );
+ check(! tester.findDisplayItemByDepth(*root, 71) );
+ check(! tester.findDisplayItemByDepth(*root, 72) );
+ check(! tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(30, 30);
+ check(tester.isMouseOverMouseEntity());
+ tester.movePointerTo(100, 30);
+ check(!tester.isMouseOverMouseEntity());
+
+
+ tester.advance();
+
+ check( tester.findDisplayItemByDepth(*root, 70) );
+ check( tester.findDisplayItemByDepth(*root, 71) );
+ check(! tester.findDisplayItemByDepth(*root, 72) );
+ check(! tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(100, 30);
+ check(tester.isMouseOverMouseEntity());
+ tester.movePointerTo(170, 30);
+ check(!tester.isMouseOverMouseEntity());
+
+ tester.advance();
+
+ check( tester.findDisplayItemByDepth(*root, 70) );
+ check( tester.findDisplayItemByDepth(*root, 71) );
+ check( tester.findDisplayItemByDepth(*root, 72) );
+ check(! tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(170, 30);
+ check(tester.isMouseOverMouseEntity());
+ tester.movePointerTo(240, 30);
+ check(!tester.isMouseOverMouseEntity());
+
+ tester.advance();
+
+ check( tester.findDisplayItemByDepth(*root, 70) );
+ check( tester.findDisplayItemByDepth(*root, 71) );
+ check( tester.findDisplayItemByDepth(*root, 72) );
+ check( tester.findDisplayItemByDepth(*root, 73) );
+
+ tester.movePointerTo(240, 30);
+ check(tester.isMouseOverMouseEntity());
+}
+