[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/morph_t...
From: |
Zou Lunkai |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/morph_t... |
Date: |
Mon, 25 Jun 2007 07:59:59 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Zou Lunkai <zoulunkai> 07/06/25 07:59:59
Modified files:
. : ChangeLog
testsuite/misc-ming.all: morph_test1.c Makefile.am
Added files:
testsuite/misc-ming.all: morph_test1runner.cpp
Log message:
add a testrunner for morph_test1
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3609&r2=1.3610
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/morph_test1.c?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.136&r2=1.137
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/morph_test1runner.cpp?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3609
retrieving revision 1.3610
diff -u -b -r1.3609 -r1.3610
--- ChangeLog 24 Jun 2007 12:58:27 -0000 1.3609
+++ ChangeLog 25 Jun 2007 07:59:58 -0000 1.3610
@@ -1,3 +1,9 @@
+2007-06-25 Zou Lunkai <address@hidden>
+
+ * testsuite/misc-ming.all/morph_test1.c: minor update, reduce a frame
for testing.
+ * testsuite/misc-ming.all/morph_test1runner.cpp, Makefile.am: add a
testrunner for
+ morph_test1.swf.
+
2007-06-24 Sandro Santilli <address@hidden>
* server/: edit_text_character.cpp, sprite_instance.cpp,
Index: testsuite/misc-ming.all/morph_test1.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/morph_test1.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/morph_test1.c 24 Jun 2007 05:49:40 -0000
1.2
+++ testsuite/misc-ming.all/morph_test1.c 25 Jun 2007 07:59:59 -0000
1.3
@@ -70,7 +70,7 @@
Ming_init();
mo = newSWFMovieWithVersion(OUTPUT_VERSION);
SWFMovie_setDimension(mo, 800, 600);
- SWFMovie_setRate (mo, 12.0);
+ SWFMovie_setRate (mo, 1.0);
// _root.frame1
dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0,
800, 600);
@@ -88,7 +88,7 @@
SWFMovie_nextFrame(mo);
// update the morph with different ratios
- for(ratio=0; ratio<1.01; ratio+=0.2)
+ for(ratio=0.2; ratio<1.01; ratio+=0.2)
{
SWFDisplayItem_remove(it);
it = SWFMovie_add(mo, (SWFBlock)morph);
Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- testsuite/misc-ming.all/Makefile.am 13 Jun 2007 09:54:10 -0000 1.136
+++ testsuite/misc-ming.all/Makefile.am 25 Jun 2007 07:59:59 -0000 1.137
@@ -152,6 +152,8 @@
NetStream-SquareTest \
NetStream-SquareTestRunner \
shape_test \
+ morph_test1 \
+ morph_test1runner \
$(NULL)
if MAKESWF_SUPPORTS_PREBUILT_CLIPS
@@ -475,6 +477,27 @@
sh $< -f20 $(top_builddir) shape_test.swf > $@
chmod 755 $@
+morph_test1_SOURCES = morph_test1.c
+morph_test1_LDADD = libgnashmingutils.la
+
+morph_test1.swf: morph_test1
+ ./morph_test1 $(top_srcdir)/testsuite/media
+
+morph_test1runner_SOURCES = \
+ morph_test1runner.cpp \
+ $(NULL)
+morph_test1runner_LDADD = \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+morph_test1runner_CXXFLAGS = \
+ -DSRCDIR='"$(srcdir)"' \
+ -DTGTDIR='"$(abs_builddir)"' \
+ $(NULL)
+morph_test1runner_DEPENDENCIES = \
+ morph_test1.swf \
+ $(top_builddir)/testsuite/libtestsuite.la \
+ $(NULL)
+
key_event_test_SOURCES = key_event_test.c
key_event_test_LDADD = libgnashmingutils.la
@@ -1538,6 +1561,7 @@
loop_test7runner \
loop_test8runner \
shape_testrunner \
+ morph_test1runner \
$(NULL)
if MAKESWF_SUPPORTS_PREBUILT_CLIPS
Index: testsuite/misc-ming.all/morph_test1runner.cpp
===================================================================
RCS file: testsuite/misc-ming.all/morph_test1runner.cpp
diff -N testsuite/misc-ming.all/morph_test1runner.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/morph_test1runner.cpp 25 Jun 2007 07:59:59
-0000 1.1
@@ -0,0 +1,92 @@
+/*
+ * 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 "morph_test1.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 = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
+ string filename = string(INPUT_FILENAME);
+ MovieTester tester(filename);
+
+ gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+ dbglogfile.setVerbosity(1);
+
+
+ rgba red(255,0,0,255); //start color
+ rgba green(0,255,0,255); //end color
+
+ int start_x = 0; //start coordinates of LU point
+ int start_y = 0;
+ int end_x = 700; //end coordinates of LU point
+ int end_y = 500;
+
+ sprite_instance* root = tester.getRootMovie();
+ assert(root);
+ check_equals(root->get_frame_count(), 7);
+
+ // FRAME 2
+ tester.advance();
+ // fill color: 1.0*red + 0.0*green
+ // center coordinates: <start_x+50, start_y+50>
+ check_pixel(50, 50, 50, red, 2); // morph ratio = 0
+
+ // FRAME 3
+ tester.advance();
+ // 0.8*red + 0.2*green
+ // center coordinates: <0.8*start_x+0.2*end_x+50, 0.8*start_y+0.2*end_y+50>
+ check_pixel(190, 150, 50, rgba(204,51,0,255), 2); // morph ratio = 0.2
+
+ // FRAME 4
+ tester.advance();
+ // fill color: 0.6*red + 0.4*green
+ check_pixel(330, 250, 50, rgba(153,102,0,255), 2); // morph ratio = 0.4
+
+ // FRAME 5
+ tester.advance();
+ // fill color: 0.4*red + 0.6*green
+ check_pixel(470, 350, 50, rgba(102,153,0,255), 2); // morph ratio = 0.6
+
+ // FRAME 6
+ tester.advance();
+ // fill color: 0.2*red + 0.8*green
+ check_pixel(610, 450, 50, rgba(51,204,0,255), 2); // morph ratio = 0.8
+
+ // FRAME 7
+ tester.advance();
+ // fill color: 0.0*red + 1.0*green
+ check_pixel(750, 550, 50, rgba(0,255,0,255), 2); // morph ratio = 1.0
+}
+