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/ming_ut...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/ming_ut...
Date: Mon, 13 Nov 2006 12:00:05 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/11/13 12:00:05

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

Log message:
                * testsuite/misc-ming.all/ming_utils.{c,h}:
                  added add_dejagnu_functions() method and fixed
                  xtrace() function to *append* rather then replace
                  the trace lines.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1600&r2=1.1601
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.c?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.h?cvsroot=gnash&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1600
retrieving revision 1.1601
diff -u -b -r1.1600 -r1.1601
--- ChangeLog   13 Nov 2006 10:08:45 -0000      1.1600
+++ ChangeLog   13 Nov 2006 12:00:04 -0000      1.1601
@@ -1,3 +1,10 @@
+2006-11-13 Sandro Santilli <address@hidden>
+
+       * testsuite/misc-ming.all/ming_utils.{c,h}:
+         added add_dejagnu_functions() method and fixed
+         xtrace() function to *append* rather then replace
+         the trace lines.
+
 2006-11-13 Hiroyuki Ikezoe <address@hidden>
 
        * utilities/Makefile.am: add missing BOOST include flags.

Index: testsuite/misc-ming.all/ming_utils.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/misc-ming.all/ming_utils.c        29 Oct 2006 18:34:18 -0000      
1.5
+++ testsuite/misc-ming.all/ming_utils.c        13 Nov 2006 12:00:05 -0000      
1.6
@@ -26,14 +26,18 @@
 add_xtrace_function(SWFMovie mo, int depth, int x, int y, int width, int 
height)
 {
        SWFAction ac;
-       char buf[1024];
 
-       sprintf(buf, "createTextField(\"out\", %d, %d, %d, %d, %d); "
+       static const size_t buflen = 1024;
+
+       char buf[buflen];
+
+       snprintf(buf, buflen, "createTextField(\"out\", %d, %d, %d, %d, %d); "
                " xtrace = function (msg) { "
                " trace (msg); "
-               " _level0.out.text = msg; "
+               " _level0.out.text += msg + '\n'; "
                "};",
                depth, x, y, width, height);
+       buf[buflen-1] = '\0';
        ac = compileSWFActionCode(buf);
 
        SWFMovie_add(mo, (SWFBlock)ac);
@@ -69,3 +73,37 @@
        return sh;
 }
 
+void
+add_dejagnu_functions(SWFMovie mo,
+       int depth, int x, int y, int width, int height)
+{
+       SWFAction ac;
+
+       add_xtrace_function(mo, depth, x, y, width, height);
+
+       static const size_t BUFLEN = 1024;
+
+       char buf[BUFLEN];
+       snprintf(buf, BUFLEN,
+               "function check_equals(obt, exp) {\n"
+               " if ( obt == exp ) xtrace('PASSED: '+obt+' == '+exp);\n"
+               " else xtrace('FAILED: 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"
+               "}\n"
+               "function check(a) {\n"
+               " if ( a ) xtrace('PASSED: '+a);\n"
+               " else xtrace('FAILED: '+a);\n"
+               "}\n"
+               "function xcheck(a) {\n"
+               " if ( a ) xtrace('XPASSED: '+a);\n"
+               " else xtrace('XFAILED: '+a);\n"
+               "}\n"
+       );
+
+       ac = compileSWFActionCode(buf);
+
+       SWFMovie_add(mo, (SWFBlock)ac);
+}

Index: testsuite/misc-ming.all/ming_utils.h
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- testsuite/misc-ming.all/ming_utils.h        29 Oct 2006 18:34:18 -0000      
1.4
+++ testsuite/misc-ming.all/ming_utils.h        13 Nov 2006 12:00:05 -0000      
1.5
@@ -26,6 +26,12 @@
 /// printing to a textfield created using the given depth, position and size
 void add_xtrace_function(SWFMovie mo, int depth, int x, int y, int width, int 
height);
 
+/// Add 'check', 'xcheck', 'check_equals', 'xcheck_equals' functions for
+/// use by embedded-swf tests.
+/// This function will internally call add_xtrace_function with the
+/// given parameters
+void add_dejagnu_functions(SWFMovie mo, int depth, int x, int y, int width, 
int height);
+
 /// Create an outline square shape with given offset, size and colors
 SWFShape make_square(int x, int y, int width, int height, byte r, byte g, byte 
b);
 




reply via email to

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