[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/DefineE... [relea
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/DefineE... [release_0_7_2] |
Date: |
Tue, 14 Nov 2006 09:38:44 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch: release_0_7_2
Changes by: Sandro Santilli <strk> 06/11/14 09:38:44
Modified files:
. : ChangeLog
testsuite/misc-ming.all: DefineEditTextVariableNameTest.c
Makefile.am ming_utils.c
Added files:
testsuite/misc-ming.all:
DefineEditTextVariableNameTest-Runner.cpp
Log message:
* testsuite/misc-ming.all/ming_utils.c (add_dejagnu_functions):
improved functions to use a TestState class, including
a totals() function.
* testsuite/misc-ming.all/DefineEditTextVariableNameTest.c:
added checks for sprites size and final call to
runtest.totals().
*
testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp,
Makefile.am:
reintroduced DefineEditTextVariableNameTest-Runner to also
test
frame advancements (removed every test already checked by
self-containsd SWF testcase)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.168&r2=1.1412.2.169
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.7.2.4&r2=1.7.2.5
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.26.2.7&r2=1.26.2.8
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.c?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.4.2.2&r2=1.4.2.3
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&rev=1.1.2.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.168
retrieving revision 1.1412.2.169
diff -u -b -r1.1412.2.168 -r1.1412.2.169
--- ChangeLog 14 Nov 2006 08:34:22 -0000 1.1412.2.168
+++ ChangeLog 14 Nov 2006 09:38:44 -0000 1.1412.2.169
@@ -1,3 +1,16 @@
+2006-11-14 Sandro Santilli <address@hidden>
+
+ * testsuite/misc-ming.all/ming_utils.c (add_dejagnu_functions):
+ improved functions to use a TestState class, including
+ a totals() function.
+ * testsuite/misc-ming.all/DefineEditTextVariableNameTest.c:
+ added checks for sprites size and final call to runtest.totals().
+ * testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp,
+ Makefile.am:
+ reintroduced DefineEditTextVariableNameTest-Runner to also test
+ frame advancements (removed every test already checked by
+ self-containsd SWF testcase)
+
2006-11-14 Patrice Dumas <address@hidden>
* remove KLASH_DIRS = plugin/klash from top-level Makefile.am, it is
Index: testsuite/misc-ming.all/DefineEditTextVariableNameTest.c
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -u -b -r1.7.2.4 -r1.7.2.5
--- testsuite/misc-ming.all/DefineEditTextVariableNameTest.c 13 Nov 2006
14:34:21 -0000 1.7.2.4
+++ testsuite/misc-ming.all/DefineEditTextVariableNameTest.c 14 Nov 2006
09:38:44 -0000 1.7.2.5
@@ -120,7 +120,7 @@
obtained, expected);
buf[BUFLEN-1] = '\0';
ac = compileSWFActionCode(buf);
- fprintf(stderr, "%s\n", buf);
+ /*fprintf(stderr, "%s\n", buf);*/
SWFMovie_add(mo, (SWFBlock)ac);
}
@@ -289,6 +289,10 @@
check_equals(mo, "mc1.textfield.text", "'Hello'", 0);
check_equals(mo, varName1, "'Hello'", 0);
check_equals(mo, "mc1.textfield._x", "0", 0);
+ check_equals(mo, "mc1._height", "16", 0);
+ check_equals(mo, "mc1._width", "136", 0);
+ check_equals(mo, "mc2._height", "16", 0);
+ check_equals(mo, "mc2._width", "100", 0);
set_text(mo, "Hi", "mc2", varName2);
shift_horizontally(mo, varName2, 10);
@@ -324,6 +328,7 @@
check_equals(mo, varName2, "''", 0);
check_equals(mo, "mc2.textfield._x", "150", 0);
+ add_actions(mo, "runtest.totals();");
add_actions(mo, "stop();");
SWFMovie_nextFrame(mo); /* showFrame */
Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -u -b -r1.26.2.7 -r1.26.2.8
--- testsuite/misc-ming.all/Makefile.am 14 Nov 2006 08:34:23 -0000 1.26.2.7
+++ testsuite/misc-ming.all/Makefile.am 14 Nov 2006 09:38:44 -0000 1.26.2.8
@@ -104,9 +104,15 @@
DefineEditTextVariableNameTest.swf: DefineEditTextVariableNameTest
./DefineEditTextVariableNameTest $(top_srcdir)/testsuite/media
-DefineEditTextVariableNameTest-Runner: $(srcdir)/../generic-testrunner.sh
DefineEditTextVariableNameTest.swf
- sh $(srcdir)/../generic-testrunner.sh $(top_builddir)
DefineEditTextVariableNameTest.swf > $@
- chmod +x $@
+DefineEditTextVariableNameTest_Runner_SOURCES = \
+ DefineEditTextVariableNameTest-Runner.cpp \
+ $(NULL)
+DefineEditTextVariableNameTest_Runner_LDADD = \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+DefineEditTextVariableNameTest_Runner_DEPENDENCIES = \
+ DefineEditTextVariableNameTest.swf \
+ $(NULL)
spritehier.swf: spritehier
./spritehier
@@ -158,9 +164,11 @@
TEST_DRIVERS = ../simple.exp
TEST_CASES = \
- RollOverOutTest-Runner \
DefineEditTextVariableNameTest-Runner \
- ButtonEventsTest-Runner
+ RollOverOutTest-Runner \
+ ButtonEventsTest-Runner \
+ $(NULL)
+
check-DEJAGNU: site-update $(check_PROGRAMS)
@runtest=$(RUNTEST); \
Index: testsuite/misc-ming.all/ming_utils.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.c,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -b -r1.4.2.2 -r1.4.2.3
--- testsuite/misc-ming.all/ming_utils.c 13 Nov 2006 11:59:42 -0000
1.4.2.2
+++ testsuite/misc-ming.all/ming_utils.c 14 Nov 2006 09:38:44 -0000
1.4.2.3
@@ -81,28 +81,63 @@
add_xtrace_function(mo, depth, x, y, width, height);
- static const size_t BUFLEN = 1024;
+ static const size_t BUFLEN = 2048;
char buf[BUFLEN];
snprintf(buf, BUFLEN,
+ "function TestState() {\n"
+ " this.passed = 0;\n"
+ " this.failed = 0;\n"
+ " this.untest = 0;\n"
+ " this.unresolve = 0;\n"
+ "};\n"
+ "TestState.prototype.fail = function (why) {\n"
+ " this.failed++;\n"
+ " xtrace('FAILED: '+why);\n"
+ "};\n"
+ "TestState.prototype.xfail = function(why) {\n"
+ " this.failed++;\n"
+ " xtrace('XFAILED: '+why);\n"
+ "};\n"
+ "TestState.prototype.pass = function(why) {\n"
+ " this.passed++;\n"
+ " xtrace('PASSED: '+why);\n"
+ "};\n"
+ "TestState.prototype.xpass = function(why) {\n"
+ " this.xpassed++;\n"
+ " xtrace('XPASSED: '+why);\n"
+ "};\n"
+ "TestState.prototype.totals = function() {\n"
+ " xtrace('#passed: '+ this.passed);\n"
+ " xtrace('#failed: '+ this.failed);\n"
+ " if ( this.xpassed ) {\n"
+ " xtrace('#unexpected successes: '+ this.xpassed);\n"
+ " }\n"
+ " if ( this.xfailed ) {\n"
+ " xtrace('#expected failures: '+ this.xfailed);\n"
+ " }\n"
+ "};\n"
+ "runtest = new TestState();\n"
"function check_equals(obt, exp) {\n"
- " if ( obt == exp ) xtrace('PASSED: '+obt+' == '+exp);\n"
- " else xtrace('FAILED: expected: '+exp+' , obtained: '+obt);\n"
+ " if ( obt == exp ) runtest.pass(obt+' == '+exp);\n"
+ " else runtest.fail('expected: '+exp+' , obtained: '+obt);\n"
"}\n"
"function xcheck_equals(obt, exp) {\n"
- " if ( obt == exp ) xtrace('XPASSED: '+obt+' == '+exp);\n"
- " else xtrace('XFAILED: expected: '+exp+' , obtained: '+obt);\n"
+ " if ( obt == exp ) runtest.xpass(obt+' == '+exp);\n"
+ " else runtest.xfail('expected: '+exp+' , obtained: '+obt);\n"
"}\n"
"function check(a) {\n"
- " if ( a ) xtrace('PASSED: '+a);\n"
- " else xtrace('FAILED: '+a);\n"
+ " if ( a ) runtest.pass(a);\n"
+ " else runtest.fail(a);\n"
"}\n"
"function xcheck(a) {\n"
- " if ( a ) xtrace('XPASSED: '+a);\n"
- " else xtrace('XFAILED: '+a);\n"
+ " if ( a ) runtest.xpass(a);\n"
+ " else runtest.xfail(a);\n"
"}\n"
);
+ /*printf("%s", buf);*/
+
ac = compileSWFActionCode(buf);
SWFMovie_add(mo, (SWFBlock)ac);
Index: testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
===================================================================
RCS file: testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
diff -N testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp 14 Nov
2006 09:38:44 -0000 1.1.2.5
@@ -0,0 +1,76 @@
+/*
+ * 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 "DefineEditTextVariableNameTest.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 = 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(), 3);
+ check_equals(root->get_play_state(), movie_interface::PLAY);
+ check_equals(root->get_current_frame(), 0);
+
+ const character* mc1 = tester.findDisplayItemByName(*root, "mc1");
+ check(mc1);
+
+ const sprite_instance* mc1_sp = \
+ dynamic_cast<const sprite_instance*>(mc1);
+ assert(mc1_sp);
+
+ tester.advance();
+
+ check_equals(root->get_play_state(), movie_interface::PLAY);
+ check_equals(root->get_current_frame(), 0);
+
+ tester.advance();
+
+ check_equals(root->get_play_state(), movie_interface::PLAY);
+ check_equals(root->get_current_frame(), 1);
+
+ tester.advance();
+
+ // does stop() on last frame
+ check_equals(root->get_play_state(), movie_interface::STOP);
+ check_equals(root->get_current_frame(), 2);
+
+}
+