gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/DefineE...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/DefineE...
Date: Wed, 15 Nov 2006 15:30:01 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/11/15 15:30:01

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: DefineEditTextVariableNameTest.c 
                                 ming_utils.c ming_utils.h 

Log message:
        Added a get_default_font function to ming_utils, cleaned up 
DefineEditTextVariab
        leNameTest.c

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1623&r2=1.1624
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.c?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.h?cvsroot=gnash&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1623
retrieving revision 1.1624
diff -u -b -r1.1623 -r1.1624
--- ChangeLog   15 Nov 2006 14:30:08 -0000      1.1623
+++ ChangeLog   15 Nov 2006 15:30:01 -0000      1.1624
@@ -4,9 +4,10 @@
          removed add_xtrace_function from header,
          changed add_dejagnu_functions to take a font object and
          to create the xtrace window w/out the drawing api (so
-         that gnash is able to use it)
+         that gnash is able to use it); added get_default_font function.
        * testsuite/misc-ming.all/DefineEditTextVariableNameTest.c:
-         use pixel coordinates.
+         use pixel coordinates, use get_default_font function, 
+         cleanups.
 
 2006-11-15 Sandro Santilli <address@hidden>
 

Index: testsuite/misc-ming.all/DefineEditTextVariableNameTest.c
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- testsuite/misc-ming.all/DefineEditTextVariableNameTest.c    15 Nov 2006 
14:30:08 -0000      1.15
+++ testsuite/misc-ming.all/DefineEditTextVariableNameTest.c    15 Nov 2006 
15:30:01 -0000      1.16
@@ -50,7 +50,7 @@
 #define OUTPUT_FILENAME "DefineEditTextVariableNameTest.swf"
 
 void add_text_field(SWFMovieClip mo, SWFBlock font, const char* varname, const 
char* text);
-void set_text(SWFMovie mo, const char* txt, const char* mcname, const char* 
varname);
+void set_text(SWFMovie mo, const char* txt, const char* varname);
 void shift_horizontally(SWFMovie mo, const char* what, int howmuch);
 void set_x(SWFMovie mo, const char* what, int x);
 
@@ -86,7 +86,7 @@
 
 
 void
-set_text(SWFMovie mo, const char* txt, const char* mcname, const char* varname)
+set_text(SWFMovie mo, const char* txt, const char* varname)
 {
        static const size_t BUFLEN = 512;
 
@@ -131,12 +131,9 @@
        SWFMovie mo;
        SWFMovieClip mc1, mc2, mc3;
        const char *srcdir=".";
-       char fdbfont[256];
        /* The variable name for textfield */
        char* varName1 = "_root.testName";
        char* varName2 = "_root.mc3.testName";
-       FILE *font_file;
-       /*SWFBrowserFont bfont; */
        SWFFont bfont; 
 
 
@@ -153,8 +150,6 @@
                return 1;
        }
 
-       sprintf(fdbfont, "%s/Bitstream Vera Sans.fdb", srcdir);
-
        puts("Setting things up");
 
        Ming_init();
@@ -165,15 +160,7 @@
        SWFMovie_setRate(mo, 1);
        SWFMovie_setDimension(mo, 628, 451);
 
-       font_file = fopen(fdbfont, "r");
-       if ( font_file == NULL )
-       {
-               perror(fdbfont);
-               exit(1);
-       }
-       /*SWFBrowserFont bfont = newSWFBrowserFont("_sans");*/
-       bfont = loadSWFFontFromFile(font_file);
-
+       bfont = get_default_font(srcdir);
 
        /***************************************************
         *
@@ -223,7 +210,7 @@
         *********************************************/
 
        /*add_xtrace_function(mo, 3000, 0, 50, 400, 800);*/
-       add_dejagnu_functions(mo, bfont, 3000, 0, 50, 400, 800);
+       add_dejagnu_functions(mo, (SWFBlock)bfont, 3000, 0, 50, 400, 800);
 
        /*********************************************
         *
@@ -232,7 +219,7 @@
         *
         *********************************************/
 
-       set_text(mo, "Hello", "mc1", varName1);
+       set_text(mo, "Hello", varName1);
        shift_horizontally(mo, varName1, 10);
        check_equals(mo, "mc1.textfield.text", "'Hello'", 0);
        check_equals(mo, varName1, "'Hello'", 0);
@@ -242,7 +229,7 @@
        check_equals(mo, "mc2._height", "16", 0);
        check_equals(mo, "mc2._width", "100", 0);
 
-       set_text(mo, "Hi", "mc2", varName2);
+       set_text(mo, "Hi", varName2);
        shift_horizontally(mo, varName2, 10);
        check_equals(mo, "mc2.textfield.text", "'Hi'", 0); 
        check_equals(mo, varName2, "'Hi'", 0);
@@ -250,13 +237,13 @@
 
        SWFMovie_nextFrame(mo); /* showFrame */
 
-       set_text(mo, "World", "mc1", varName1);
+       set_text(mo, "World", varName1);
        shift_horizontally(mo, varName1, 10);
        check_equals(mo, "mc1.textfield.text", "'World'", 0);
        check_equals(mo, varName1, "'World'", 0);
        check_equals(mo, "mc1.textfield._x", "0", 0);
 
-       set_text(mo, "There", "mc2", varName2);
+       set_text(mo, "There", varName2);
        shift_horizontally(mo, varName2, 10);
        check_equals(mo, "mc2.textfield.text", "'There'", 0);
        check_equals(mo, varName2, "'There'", 0);
@@ -264,13 +251,13 @@
 
        SWFMovie_nextFrame(mo); /* showFrame */
 
-       set_text(mo, "", "mc1", varName1);
+       set_text(mo, "", varName1);
        shift_horizontally(mo, varName1, 10);
        check_equals(mo, "mc1.textfield.text", "''", 0);
        check_equals(mo, varName1, "''", 0);
        check_equals(mo, "mc1.textfield._x", "0", 0);
 
-       set_text(mo, "", "mc2", varName2);
+       set_text(mo, "", varName2);
        shift_horizontally(mo, varName2, 10);
        check_equals(mo, "mc2.textfield.text", "''", 0);
        check_equals(mo, varName2, "''", 0);

Index: testsuite/misc-ming.all/ming_utils.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/misc-ming.all/ming_utils.c        15 Nov 2006 14:30:08 -0000      
1.9
+++ testsuite/misc-ming.all/ming_utils.c        15 Nov 2006 15:30:01 -0000      
1.10
@@ -216,4 +216,21 @@
        add_actions(mo, "runtest.totals();");
 }
 
+SWFFont
+get_default_font(const char* mediadir)
+{
+       FILE *font_file;
+       char fdbfont[256];
+
+       sprintf(fdbfont, "%s/Bitstream Vera Sans.fdb", mediadir);
+
+       font_file = fopen(fdbfont, "r");
+       if ( font_file == NULL )
+       {
+               perror(fdbfont);
+               exit(1);
+       }
+       return loadSWFFontFromFile(font_file);
+}
+
 

Index: testsuite/misc-ming.all/ming_utils.h
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- testsuite/misc-ming.all/ming_utils.h        15 Nov 2006 14:30:08 -0000      
1.7
+++ testsuite/misc-ming.all/ming_utils.h        15 Nov 2006 15:30:01 -0000      
1.8
@@ -23,6 +23,15 @@
 #include <ming.h>
 
 /** \brief
+ * Get the default font for Gnash testcases.
+ * 
+ * @param mediadir
+ *     the 'media' directory under testsuite/ dir of
+ *     Gnash source tree.
+ */
+SWFFont get_default_font(const char* mediadir);
+
+/** \brief
  * Add 'check', 'xcheck', 'check_equals', 'xcheck_equals' ActionScript
  * functions for use by embedded-swf tests, and a textfield to print
  * results of the checks to (results will additionally be 'traced').




reply via email to

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