gnash-commit
[Top][All Lists]
Advanced

[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, 02 Apr 2007 10:47:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/02 10:47:36

Modified files:
        .              : ChangeLog 
        testsuite/samples: Makefile.am 
Added files:
        testsuite/samples: gotoFrameOnKeyEvent-TestRunner.cpp 

Log message:
                * testsuite/samples/: Makefile.am, 
gotoFrameOnKeyEvent-TestRunner.cpp:
                  First stub at an automated test runner for 
gotoFrameOnKeyEvent.
                  TODO item in comments.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2748&r2=1.2749
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/Makefile.am?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/gotoFrameOnKeyEvent-TestRunner.cpp?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2748
retrieving revision 1.2749
diff -u -b -r1.2748 -r1.2749
--- ChangeLog   2 Apr 2007 10:42:21 -0000       1.2748
+++ ChangeLog   2 Apr 2007 10:47:36 -0000       1.2749
@@ -1,3 +1,9 @@
+2007-04-02 Sandro Santilli <address@hidden>
+
+       * testsuite/samples/: Makefile.am, gotoFrameOnKeyEvent-TestRunner.cpp:
+         First stub at an automated test runner for gotoFrameOnKeyEvent.
+         TODO item in comments.
+
 2007-04-02 Bastiaan Jacques <address@hidden>
 
        * server/as_value{.cpp, .h}: Declare NAN in the header

Index: testsuite/samples/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/samples/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- testsuite/samples/Makefile.am       27 Feb 2007 09:10:21 -0000      1.13
+++ testsuite/samples/Makefile.am       2 Apr 2007 10:47:36 -0000       1.14
@@ -38,6 +38,7 @@
 
 check_PROGRAMS = \
        clip_as_button2-TestRunner \
+       gotoFrameOnKeyEvent-TestRunner \
        $(NULL)
 
 check_SCRIPTS = \
@@ -58,6 +59,20 @@
        $(top_builddir)/testsuite/libtestsuite.la \
        $(NULL)
 
+gotoFrameOnKeyEvent_TestRunner_SOURCES = \
+       gotoFrameOnKeyEvent-TestRunner.cpp \
+       $(NULL)
+gotoFrameOnKeyEvent_TestRunner_LDADD = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+gotoFrameOnKeyEvent_TestRunner_CXXFLAGS = \
+       -DSRCDIR='"$(srcdir)"' \
+       $(NULL)
+gotoFrameOnKeyEvent_TestRunner_DEPENDENCIES = \
+       gotoFrameOnKeyEvent.swf \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+
 GotoAndPlayTestRunner: $(srcdir)/../generic-testrunner.sh 
$(srcdir)/GotoAndPlayTest.swf
        sh $< $(top_builddir) $(srcdir)/GotoAndPlayTest.swf > $@
        chmod 755 $@

Index: testsuite/samples/gotoFrameOnKeyEvent-TestRunner.cpp
===================================================================
RCS file: testsuite/samples/gotoFrameOnKeyEvent-TestRunner.cpp
diff -N testsuite/samples/gotoFrameOnKeyEvent-TestRunner.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/samples/gotoFrameOnKeyEvent-TestRunner.cpp        2 Apr 2007 
10:47:36 -0000       1.1
@@ -0,0 +1,81 @@
+/* 
+ *   Copyright (C) 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
+ *
+ *
+ */ 
+
+#define INPUT_FILENAME "gotoFrameOnKeyEvent.swf"
+
+#include "MovieTester.h"
+#include "GnashException.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(SRCDIR) + string("/") + string(INPUT_FILENAME);
+       auto_ptr<MovieTester> t;
+
+       gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+       dbglogfile.setVerbosity(1);
+
+       try
+       {
+               t.reset(new MovieTester(filename));
+       }
+       catch (const GnashException& e)
+       {
+               std::cerr << "Error initializing MovieTester: " << e.what() << 
std::endl;
+               exit(EXIT_FAILURE);
+       }
+       
+       MovieTester& tester = *t;
+
+       // TODO: check why we need this !!
+       //       I wouldn't want the first advance to be needed
+       tester.advance();
+
+       sprite_instance* root = tester.getRootMovie();
+       assert(root);
+
+       check_equals(root->get_frame_count(), 7);
+
+       check_equals(root->get_current_frame(), 0);
+       tester.advance();
+       check_equals(root->get_current_frame(), 0);
+
+       tester.pressKey(key::_1);
+
+       // TODO: check if it is correct to wait for next ::advance before 
expecting gotoFrame actions
+       //       execution !!
+
+       xcheck_equals(root->get_current_frame(), 1);
+       tester.advance();
+       check_equals(root->get_current_frame(), 1);
+
+}
+




reply via email to

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