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: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Thu, 25 Jan 2007 10:55:30 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/01/25 10:55:30

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: simple_loop_test.c 
                                 simple_loop_testrunner.cpp 

Log message:
                * testsuite/misc-ming.all/: Makefile.am, simple_loop_test.c,
                  Simple_loop_testrunner.cpp: new test for simple loop.
                  Seems to work internally, but reveals a bug in invalidated
                  bounds computation !!

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2171&r2=1.2172
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/simple_loop_test.c?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/simple_loop_testrunner.cpp?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2171
retrieving revision 1.2172
diff -u -b -r1.2171 -r1.2172
--- ChangeLog   25 Jan 2007 01:00:37 -0000      1.2171
+++ ChangeLog   25 Jan 2007 10:55:29 -0000      1.2172
@@ -1,3 +1,10 @@
+2007-01-24 Sandro Santilli <address@hidden>
+
+       * testsuite/misc-ming.all/: Makefile.am, simple_loop_test.c,
+         Simple_loop_testrunner.cpp: new test for simple loop.
+         Seems to work internally, but reveals a bug in invalidated
+         bounds computation !!
+
 2007-01-24 Ann Barcomb <address@hidden>
 
        * Replaced outdated references to -a in the manual (doc/C)

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- testsuite/misc-ming.all/Makefile.am 24 Jan 2007 23:33:01 -0000      1.57
+++ testsuite/misc-ming.all/Makefile.am 25 Jan 2007 10:55:29 -0000      1.58
@@ -75,6 +75,8 @@
        registerClassTest \
        registerClassTestRunner \
        goto_frame_test \
+       simple_loop_test \
+       simple_loop_testrunner \
        action_execution_order_test \
        $(NULL)
 
@@ -304,6 +306,32 @@
        $(top_builddir)/testsuite/libtestsuite.la \
        $(NULL)
 
+simple_loop_test_SOURCES =     \
+       simple_loop_test.c      \
+       ming_utils.h            \
+       ming_utils.c            \
+       $(NULL)
+simple_loop_test_LDADD = $(MING_LIBS)
+
+simple_loop_test.swf: simple_loop_test
+       ./simple_loop_test $(top_srcdir)/testsuite/media
+
+simple_loop_testrunner_SOURCES = \
+       simple_loop_testrunner.cpp \
+       $(NULL)
+simple_loop_testrunner_LDADD = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+simple_loop_testrunner_CXXFLAGS = \
+       -DSRCDIR='"$(srcdir)"' \
+       -DTGTDIR='"$(abs_builddir)"' \
+       $(NULL)
+simple_loop_testrunner_DEPENDENCIES = \
+       simple_loop_test.swf \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+
+
 goto_frame_test_SOURCES =      \
        goto_frame_test.c       \
        ming_utils.h            \
@@ -441,6 +469,7 @@
        goto_frame_testrunner \
        registerClassTestRunner \
        action_execution_order_testrunner \
+       simple_loop_testrunner \
        $(NULL)
 
 

Index: testsuite/misc-ming.all/simple_loop_test.c
===================================================================
RCS file: testsuite/misc-ming.all/simple_loop_test.c
diff -N testsuite/misc-ming.all/simple_loop_test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/simple_loop_test.c  25 Jan 2007 10:55:30 -0000      
1.1
@@ -0,0 +1,113 @@
+/*
+ *   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
+ *
+ */ 
+
+/*
+ * Simple test for loopback
+ *
+ * The root movie has 4 frames
+ * First frame initializes the dejagnu stuff.
+ * Each frame from 2nd to 4th place a character on the stage.
+ * Last frame (4) contains a goto_frame(2).
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "simple_loop_test.swf"
+
+static SWFShape
+get_shape(int r, int g, int b)
+{
+       SWFMovieClip mc = newSWFMovieClip();
+       SWFShape  sh  = make_fill_square (0, 300, 60, 60, r, g, b, r, g, b);
+       //SWFMovieClip_add(mc, (SWFBlock)sh); 
+       //SWFMovieClip_nextFrame(mc);
+       return sh;
+}
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip mc, dejagnuclip;
+  SWFDisplayItem it;
+
+  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.0);
+
+  /***************************************************************
+   * Frame 1 (empty)
+   ***************************************************************/
+
+  SWFMovie_nextFrame(mo);
+
+  
+  /***************************************************************
+   * Frame 2
+   ***************************************************************/
+
+  mc = get_shape(255, 0, 0);
+  it = SWFMovie_add(mo, (SWFBlock)mc);
+  SWFDisplayItem_setDepth(it, 2); 
+  SWFMovie_nextFrame(mo); 
+
+  /***************************************************************
+   * Frame 3
+   ***************************************************************/
+
+  mc = get_shape(0, 255, 0);
+  it = SWFMovie_add(mo, (SWFBlock)mc);
+  SWFDisplayItem_moveTo(it, 60, 0);
+  SWFDisplayItem_setDepth(it, 3); 
+  SWFMovie_nextFrame(mo); 
+
+  /***************************************************************
+   * Frame 4
+   ***************************************************************/
+
+  mc = get_shape(0, 0, 255);
+  it = SWFMovie_add(mo, (SWFBlock)mc);
+  SWFDisplayItem_moveTo(it, 120, 0);
+  SWFDisplayItem_setDepth(it, 4);
+  SWFMovie_nextFrame(mo); 
+
+
+  //Output movie
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}
+
+
+

Index: testsuite/misc-ming.all/simple_loop_testrunner.cpp
===================================================================
RCS file: testsuite/misc-ming.all/simple_loop_testrunner.cpp
diff -N testsuite/misc-ming.all/simple_loop_testrunner.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/simple_loop_testrunner.cpp  25 Jan 2007 10:55:30 
-0000      1.1
@@ -0,0 +1,128 @@
+/* 
+ *   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
+ *
+ *
+ */ 
+
+// TODO: fix invalidated bounds, which are clearly bogus !
+
+#define INPUT_FILENAME "simple_loop_test.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*/)
+{
+       typedef gnash::geometry::Range2d<int> Bounds;
+
+       string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
+       MovieTester tester(filename);
+
+       gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+       dbglogfile.setVerbosity(1);
+
+       Bounds invalidatedBounds;
+       sprite_instance* root = tester.getRootMovie();
+       assert(root);
+
+       // FRAME 1/4 (start)
+
+       check_equals(root->get_frame_count(), 4);
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 0);
+       check_equals(root->getDisplayList().size(), 0); // no chars
+
+       invalidatedBounds = tester.getInvalidatedBounds();
+       check_equals(invalidatedBounds, Bounds().setNull());
+
+       tester.advance(); // FRAME 2/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 1);
+       check_equals(root->getDisplayList().size(), 1);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       xcheck_equals( invalidatedBounds, Bounds(0, 0, 60, 60) );
+
+       tester.advance(); // FRAME 3/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 2);
+
+       check_equals(root->getDisplayList().size(), 2);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 3) );
+       xcheck_equals( invalidatedBounds, Bounds(60, 0, 120, 60) );
+
+       tester.advance(); // FRAME 4/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 3);
+       check_equals(root->getDisplayList().size(), 3);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 3) );
+       check( tester.findDisplayItemByDepth(*root, 4) );
+       xcheck_equals( invalidatedBounds, Bounds(120, 0, 180, 60) );
+
+       tester.advance(); // FRAME 1/4 (loop back)
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 0);
+       check_equals(root->getDisplayList().size(), 0);
+       xcheck_equals( invalidatedBounds, Bounds(0, 0, 180, 60) );
+
+       tester.advance(); // FRAME 2/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 1);
+
+       check_equals(root->getDisplayList().size(), 1);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       xcheck_equals( invalidatedBounds, Bounds(0, 0, 60, 60) );
+
+       tester.advance(); // FRAME 3/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 2);
+
+       check_equals(root->getDisplayList().size(), 2);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 3) );
+       xcheck_equals( invalidatedBounds, Bounds(60, 0, 120, 60) );
+
+       tester.advance(); // FRAME 4/4
+       
+       check_equals(root->get_play_state(), sprite_instance::PLAY);
+       check_equals(root->get_current_frame(), 3);
+       check_equals(root->getDisplayList().size(), 3);
+       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 3) );
+       check( tester.findDisplayItemByDepth(*root, 4) );
+       xcheck_equals( invalidatedBounds, Bounds(120, 0, 180, 60) );
+
+}
+




reply via email to

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