[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/samples/Makefile.am t...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/samples/Makefile.am t... |
Date: |
Mon, 11 Dec 2006 18:10:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/11 18:10:25
Modified files:
. : ChangeLog
testsuite/samples: Makefile.am README
Added files:
testsuite/samples: loop_test-Runner.cpp loop_test.swf
Log message:
* testsuite/samples/: Makefile.am, README, loop_test-Runner.cpp,
loop_test.swf: Added contributed SWF test and associated test
runner.
See patch #5620.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1911&r2=1.1912
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/Makefile.am?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/README?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/loop_test-Runner.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/loop_test.swf?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1911
retrieving revision 1.1912
diff -u -b -r1.1911 -r1.1912
--- ChangeLog 11 Dec 2006 11:32:23 -0000 1.1911
+++ ChangeLog 11 Dec 2006 18:10:24 -0000 1.1912
@@ -1,4 +1,11 @@
+2006-12-11 Sandro Santilli <address@hidden>
+
+ * testsuite/samples/: Makefile.am, README, loop_test-Runner.cpp,
+ loop_test.swf: Added contributed SWF test and associated test runner.
+ See patch #5620.
+
2006-12-11 Ann Barcomb <address@hidden>
+
* Modified plugin list in documentation,
based upon comments from Bastiaan.
Index: testsuite/samples/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/samples/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- testsuite/samples/Makefile.am 8 Dec 2006 12:01:53 -0000 1.6
+++ testsuite/samples/Makefile.am 11 Dec 2006 18:10:25 -0000 1.7
@@ -40,6 +40,7 @@
check_PROGRAMS = \
clip_as_button2-TestRunner \
+ loop_test-Runner \
$(NULL)
clip_as_button2_TestRunner_SOURCES = \
@@ -56,12 +57,31 @@
$(top_builddir)/testsuite/libtestsuite.la \
$(NULL)
+loop_test_Runner_SOURCES = \
+ loop_test-Runner.cpp \
+ $(NULL)
+loop_test_Runner_LDADD = \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+loop_test_Runner_CXXFLAGS = \
+ -DSRCDIR='"$(srcdir)"' \
+ $(NULL)
+loop_test_Runner_DEPENDENCIES = \
+ loop_test.swf \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+
clean-local:
-EXTRA_DIST = clip_as_button2.swf
+EXTRA_DIST = \
+ clip_as_button2.swf \
+ loop_test.swf \
+ README \
+ $(NULL)
+
TEST_DRIVERS = ../simple.exp
TEST_CASES = \
- clip_as_button2-TestRunner
+ $(check_PROGRAMS)
check-DEJAGNU: site-update $(check_PROGRAMS)
@runtest=$(RUNTEST); \
Index: testsuite/samples/README
===================================================================
RCS file: /sources/gnash/gnash/testsuite/samples/README,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/samples/README 2 Nov 2006 09:59:42 -0000 1.3
+++ testsuite/samples/README 11 Dec 2006 18:10:25 -0000 1.4
@@ -392,3 +392,19 @@
== Description ==
+= [loop_test.swf] =
+
+== Origin ==
+
+Contributed by address@hidden
+See: https://savannah.gnu.org/patch/?5620
+
+== Description ==
+
+The movie contains a black circle at depth 4 and a red square
+at depth 1. It has 30 frames, and in frame 28 the depths
+of the two characters are swapped.
+Whenever the movie is played again (looped), the depth assigned
+by action should be kept.
+
+
Index: testsuite/samples/loop_test-Runner.cpp
===================================================================
RCS file: testsuite/samples/loop_test-Runner.cpp
diff -N testsuite/samples/loop_test-Runner.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/samples/loop_test-Runner.cpp 11 Dec 2006 18:10:25 -0000
1.1
@@ -0,0 +1,114 @@
+/*
+ * 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 "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 <iostream>
+#include <cassert>
+
+using namespace gnash;
+using namespace std;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+ string filename = string(SRCDIR) + string("/") + string(INPUT_FILENAME);
+ MovieTester tester(filename);
+
+ // TODO: check why we need this !!
+ // I wouldn't want the first advance to be needed
+ tester.advance();
+
+ gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+ dbglogfile.setVerbosity(1);
+
+ sprite_instance* root = tester.getRootMovie();
+ assert(root);
+
+ check_equals(root->get_frame_count(), 30);
+
+ const character* rectangle = tester.findDisplayItemByDepth(*root, 1);
+ check(rectangle);
+ check_equals(rectangle->get_name(), "sprite2");
+ check_equals(rectangle->get_width(), 126*20);
+
+ const character* circle = tester.findDisplayItemByDepth(*root, 4);
+ check(circle);
+ check_equals(circle->get_name(), "sprite1");
+ check_equals(circle->get_width(), 111*20);
+
+ // Advance to frame 27
+ for (int i=root->get_current_frame(); i<27; ++i) {
+ tester.advance();
+ }
+
+ check_equals(root->get_current_frame(), 27);
+ check_equals(rectangle->get_depth(), 1);
+ check_equals(circle->get_depth(), 4);
+
+ // In frame 28, a swapDepth() action will
+ // change the characters depth
+ tester.advance();
+ check_equals(root->get_current_frame(), 28);
+ check_equals(rectangle->get_depth(), 4);
+ check_equals(circle->get_depth(), 1);
+
+ // Now keep advancing until last frame is reached
+ // (29, as framecount is 0-based)
+ for (int i=root->get_current_frame(); i<29; ++i) {
+ tester.advance();
+ }
+
+ check_equals(root->get_current_frame(), 29);
+ check_equals(rectangle->get_depth(), 4);
+ check_equals(circle->get_depth(), 1);
+
+
+ // Next advance will make the movie restart
+ tester.advance();
+ check_equals(root->get_current_frame(), 0);
+
+ // We expect the depth to be kept on restart
+ check_equals(rectangle->get_depth(), 4);
+ check_equals(circle->get_depth(), 1);
+
+ // ... until next SwapDepth ...
+
+ for (int i=root->get_current_frame(); i<27; ++i) {
+ tester.advance();
+ }
+
+ check_equals(rectangle->get_depth(), 4);
+ check_equals(circle->get_depth(), 1);
+ // depths swapped again
+ tester.advance();
+ check_equals(root->get_current_frame(), 28);
+ check_equals(rectangle->get_depth(), 1);
+ check_equals(circle->get_depth(), 4);
+}
+
Index: testsuite/samples/loop_test.swf
===================================================================
RCS file: testsuite/samples/loop_test.swf
diff -N testsuite/samples/loop_test.swf
Binary files /dev/null and /tmp/cvs7W9uqZ differ