gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-323-g081407d
Date: Fri, 29 Apr 2011 07:50:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  081407de71c4f8c345ffe1a67d0560ab2223bada (commit)
      from  072ba8a9940d26466fd2e730d55a8f2fa1de52f0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=081407de71c4f8c345ffe1a67d0560ab2223bada


commit 081407de71c4f8c345ffe1a67d0560ab2223bada
Author: Sandro Santilli <address@hidden>
Date:   Fri Apr 29 09:30:06 2011 +0200

    Add automated test for embedded event sound .position, aka "tictac" 
(https://savannah.gnu.org/bugs/?33091)

diff --git a/testsuite/movies.all/Makefile.am b/testsuite/movies.all/Makefile.am
index 0c09cab..ca32502 100644
--- a/testsuite/movies.all/Makefile.am
+++ b/testsuite/movies.all/Makefile.am
@@ -20,11 +20,11 @@ AUTOMAKE_OPTIONS = dejagnu
 
 check_PROGRAMS = \
        gravity_embedded-TestRunner \
+       tic_tac2-TestRunner \
        $(NULL)
 
 TEST_DRIVERS = ../simple.exp
-TEST_CASES = \
-       gravity_embedded-TestRunner
+TEST_CASES = $(check_PROGRAMS)
 
 CLEANFILES =  \
       gnash-dbg.log \
@@ -68,9 +68,24 @@ gravity_embedded_TestRunner_DEPENDENCIES = \
        gravity.swf \
        $(NULL)
 
+tic_tac2_TestRunner_SOURCES = \
+       tic_tac2-TestRunner.cpp \
+       $(NULL)
+tic_tac2_TestRunner_LDADD = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(AM_LDFLAGS) \
+       $(NULL)
+tic_tac2_TestRunner_CXXFLAGS = \
+       -DSRCDIR='"$(srcdir)"' \
+       $(NULL)
+tic_tac2_TestRunner_DEPENDENCIES = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       tic_tac2.swf \
+       $(NULL)
+
 clean-local: 
 
-EXTRA_DIST = gravity-embedded.swf gravity.swf
+EXTRA_DIST = gravity-embedded.swf gravity.swf tic_tac2.swf
 
 
 check-DEJAGNU: site-update $(check_PROGRAMS)
diff --git a/testsuite/movies.all/README b/testsuite/movies.all/README
index 056ab01..4ebde11 100644
--- a/testsuite/movies.all/README
+++ b/testsuite/movies.all/README
@@ -66,3 +66,17 @@ Wyoming, MI 49509-1455.  The request was made by Greg 
Trounson.
 
 == Description ==
 
+...
+
+= [tic_tac2.swf] =
+
+== Origin ==
+
+Contributed by Sergio Costas <address@hidden>.
+See http://savannah.gnu.org/bugs/?20684
+
+== Description ==
+
+Tests Sound.position against a playing embedded event sound.
+Regressed in 6b478714a7264187cce8bd6d24c458ed94441843
+(see https://savannah.gnu.org/bugs/?33091)
diff --git a/testsuite/movies.all/tic_tac2-TestRunner.cpp 
b/testsuite/movies.all/tic_tac2-TestRunner.cpp
new file mode 100644
index 0000000..82a06f2
--- /dev/null
+++ b/testsuite/movies.all/tic_tac2-TestRunner.cpp
@@ -0,0 +1,107 @@
+/* 
+ *   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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 3 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 "tic_tac2.swf"
+
+#include "MovieTester.h"
+#include "MovieClip.h"
+#include "Button.h"
+#include "DisplayObject.h"
+#include "DisplayList.h"
+#include "log.h"
+#include "VM.h"
+#include "TextField.h"
+
+#include "check.h"
+#include <string>
+#include <cassert>
+#include <sstream>
+
+using namespace gnash;
+using namespace std;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+       string filename = string(SRCDIR) + string("/") + string(INPUT_FILENAME);
+       MovieTester tester(filename);
+
+       gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+       dbglogfile.setVerbosity(1);
+
+       const MovieClip* root = tester.getRootMovie();
+       assert(root);
+
+       check_equals(root->get_frame_count(), 10);
+       check_equals(root->get_current_frame(), 0);
+
+       const MovieClip* slides = dynamic_cast<const MovieClip*>(
+               tester.findDisplayItemByTarget("_level0.slides"));
+       check(slides);
+
+       const Button* button = dynamic_cast<const Button*>(
+               tester.findDisplayItemByTarget("_level0.b1"));
+       check(button);
+
+       tester.advance(); 
+       check_equals(root->get_current_frame(), 1);
+       check_equals(slides->get_current_frame(), 0);
+
+       // Not much happens w/out clicking on the play button
+       for (int i=0; i<10; ++i) tester.advance(); 
+       check_equals(root->get_current_frame(), 1);
+       check_equals(slides->get_current_frame(), 0);
+
+       // Should start now
+       tester.movePointerTo(395, 301); tester.click();
+       check_equals(root->get_current_frame(), 1);
+       check_equals(slides->get_current_frame(), 0);
+
+       for (int i=0; i<3; ++i) {
+               std::stringstream s; s << "iteration " << i;
+               tester.advance(); 
+               check_equals_label(s.str(), root->get_current_frame(), 2+i);
+               check_equals_label(s.str(), slides->get_current_frame(), 0);
+       }
+
+    // Tweak initial offset (dunno based on what really)
+    tester.advanceClock(1000);
+    tester.advance(false); 
+       check_equals(root->get_current_frame(), 4);
+       check_equals(slides->get_current_frame(), 0);
+
+       for (int i=0; i<12; ++i) {
+        tester.advanceClock(1000);
+        tester.advance(false); 
+               std::stringstream s; s << "i" << i;
+           check_equals_label(s.str(), slides->get_current_frame(), i);
+        // TODO: check invalidated bounds!
+    }
+
+       check_equals(slides->get_current_frame(), 11);
+       check_equals(root->get_current_frame(), 4);
+
+    // It's stuck there
+       for (int i=0; i<10; ++i) tester.advance(); 
+       check_equals(slides->get_current_frame(), 11);
+       check_equals(root->get_current_frame(), 4);
+
+}
+
diff --git a/testsuite/movies.all/tic_tac2.swf 
b/testsuite/movies.all/tic_tac2.swf
new file mode 100644
index 0000000..0f067cf
Binary files /dev/null and b/testsuite/movies.all/tic_tac2.swf differ

-----------------------------------------------------------------------

Summary of changes:
 testsuite/movies.all/Makefile.am             |   21 +++++-
 testsuite/movies.all/README                  |   14 ++++
 testsuite/movies.all/tic_tac2-TestRunner.cpp |  107 ++++++++++++++++++++++++++
 testsuite/movies.all/tic_tac2.swf            |  Bin 0 -> 13041 bytes
 4 files changed, 139 insertions(+), 3 deletions(-)
 create mode 100644 testsuite/movies.all/tic_tac2-TestRunner.cpp
 create mode 100644 testsuite/movies.all/tic_tac2.swf


hooks/post-receive
-- 
Gnash



reply via email to

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