[Top][All Lists]
[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: |
Sat, 30 Dec 2006 23:39:04 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/30 23:39:04
Modified files:
. : ChangeLog
testsuite/misc-ming.all: ming_utils.h ming_utils.c
DefineEditTextVariableNameTest.c
Log message:
* testsuite/misc-ming.all/ming_utils.{h,c}:
Added compile_actions() method, removed check/check_equals
function and substituted with
check/check_equals/xcheck/xcheck_equals macros (so you
get the source file line number of failing cases).
* testsuite/misc-ming.all/DefineEditTextVariableNameTest.c:
updated calls to check/check_equals
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2017&r2=1.2018
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ming_utils.c?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c?cvsroot=gnash&r1=1.18&r2=1.19
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2017
retrieving revision 1.2018
diff -u -b -r1.2017 -r1.2018
--- ChangeLog 30 Dec 2006 23:34:09 -0000 1.2017
+++ ChangeLog 30 Dec 2006 23:39:04 -0000 1.2018
@@ -1,5 +1,12 @@
2006-12-30 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/ming_utils.{h,c}:
+ Added compile_actions() method, removed check/check_equals
+ function and substituted with
+ check/check_equals/xcheck/xcheck_equals macros (so you
+ get the source file line number of failing cases).
+ * testsuite/misc-ming.all/DefineEditTextVariableNameTest.c:
+ updated calls to check/check_equals
* server/as_object.h (get_numeric_value): return 0 if
get_text_value() returns NULL.
* testsuite/generic-testrunner.sh: accept -r switch
Index: testsuite/misc-ming.all/ming_utils.h
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/misc-ming.all/ming_utils.h 16 Nov 2006 00:35:32 -0000
1.9
+++ testsuite/misc-ming.all/ming_utils.h 30 Dec 2006 23:39:04 -0000
1.10
@@ -81,7 +81,19 @@
* @param expected_failure
* Set to 1 if a failure is expected
*/
-void check(SWFMovie mo, const char* expr, int expected_failure);
+//void check(SWFMovie mo, const char* expr, int expected_failure);
+#define check(m, expr) \
+ SWFMovie_add(m, (SWFBlock)compile_actions("\
+ if ( %s ) pass( \"%s [%d]\"); \
+ else fail( \"%s [%d] \"); \
+ ", expr, expr, __LINE__, expr, __LINE__));
+
+#define xcheck(m, expr) \
+ SWFMovie_add(m, (SWFBlock)compile_actions("\
+ if ( %s ) xpass( \"%s [%d]\"); \
+ else xfail( \"%s [%d] \"); \
+ ", expr, expr, __LINE__, expr, __LINE__));
+
/** \brief
* Evaluate equality of two ActionScript expressions updating the global
@@ -100,7 +112,20 @@
* @param expected_failure
* Set to 1 if a failure is expected
*/
-void check_equals(SWFMovie mo, const char* obtained, const char* expected, int
expected_failure);
+//void check_equals(SWFMovie mo, const char* obtained, const char* expected,
int expected_failure);
+#define check_equals(m, obt, exp) \
+ SWFMovie_add(m, (SWFBlock)compile_actions("\
+ if ( %s == %s ) pass( \"%s == %s [%d]\"); \
+ else fail( \"expected: %s obtained: \" + obt + \" [%d] \"); \
+ ", obt, exp, obt, exp, __LINE__, exp, __LINE__));
+
+#define xcheck_equals(m, obt, exp) \
+ SWFMovie_add(m, (SWFBlock)compile_actions("\
+ if ( %s == %s ) xpass( \"%s == %s [%d]\"); \
+ else xfail( \"expected: %s obtained: \" + obt + \" [%d] \"); \
+ ", obt, exp, obt, exp, __LINE__, exp, __LINE__));
+
+
/** \brief
* Print TestState total summary.
@@ -112,6 +137,11 @@
void print_tests_summary(SWFMovie mo);
/** \brief
+ * Compile ActionScript code using printf-like formatting
+ */
+SWFAction compile_actions(const char* fmt, ...);
+
+/** \brief
* Add an arbitrary ActionScript code in the given movie
*
* @param mo
Index: testsuite/misc-ming.all/ming_utils.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ming_utils.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- testsuite/misc-ming.all/ming_utils.c 28 Nov 2006 17:47:37 -0000
1.19
+++ testsuite/misc-ming.all/ming_utils.c 30 Dec 2006 23:39:04 -0000
1.20
@@ -17,10 +17,12 @@
*
*/
+#include "ming_utils.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <ming.h>
-#include <ming_utils.h>
+#include <stdarg.h>
void add_xtrace_function_clip(SWFMovieClip mo, SWFBlock font, int depth, int
x, int y, int width, int height);
@@ -280,44 +282,27 @@
}
void
-check(SWFMovie mo, const char* expr,
- int expected_failure)
+add_clip_actions(SWFMovieClip mo, const char* code)
{
- static const size_t BUFLEN = 512;
-
- char buf[BUFLEN];
SWFAction ac;
- snprintf(buf, BUFLEN, "%scheck(%s);",
- expected_failure ? "x" : "",
- expr);
- buf[BUFLEN-1] = '\0';
- ac = compileSWFActionCode(buf);
- SWFMovie_add(mo, (SWFBlock)ac);
+ ac = compileSWFActionCode(code);
+ SWFMovieClip_add(mo, (SWFBlock)ac);
}
-void
-check_equals(SWFMovie mo, const char* obtained, const char* expected,
- int expected_failure)
+SWFAction
+compile_actions(const char* fmt, ...)
{
- static const size_t BUFLEN = 512;
-
- char buf[BUFLEN];
SWFAction ac;
- snprintf(buf, BUFLEN, "%scheck_equals(%s, %s);",
- (expected_failure ? "x" : ""),
- obtained, expected);
- buf[BUFLEN-1] = '\0';
- ac = compileSWFActionCode(buf);
- /*fprintf(stderr, "%s\n", buf);*/
- SWFMovie_add(mo, (SWFBlock)ac);
-}
+ size_t BUFFER_SIZE = 65535;
+ va_list ap;
+ char tmp[BUFFER_SIZE];
+
+ va_start (ap, fmt);
+ vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
+ tmp[BUFFER_SIZE-1] = '\0';
-void
-add_clip_actions(SWFMovieClip mo, const char* code)
-{
- SWFAction ac;
- ac = compileSWFActionCode(code);
- SWFMovieClip_add(mo, (SWFBlock)ac);
+ ac = compileSWFActionCode(tmp);
+ return ac;
}
void
Index: testsuite/misc-ming.all/DefineEditTextVariableNameTest.c
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- testsuite/misc-ming.all/DefineEditTextVariableNameTest.c 29 Nov 2006
10:59:21 -0000 1.18
+++ testsuite/misc-ming.all/DefineEditTextVariableNameTest.c 30 Dec 2006
23:39:04 -0000 1.19
@@ -157,49 +157,49 @@
set_text(mo, "Hello", varName1);
shift_horizontally(mo, varName1, 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);
+ check_equals(mo, "mc1.textfield.text", "'Hello'");
+ check_equals(mo, varName1, "'Hello'");
+ check_equals(mo, "mc1.textfield._x", "0");
+ check_equals(mo, "mc1._height", "16");
+ check_equals(mo, "mc1._width", "136");
+ check_equals(mo, "mc2._height", "16");
+ check_equals(mo, "mc2._width", "100");
set_text(mo, "Hi", varName2);
shift_horizontally(mo, varName2, 10);
- check_equals(mo, "mc2.textfield.text", "'Hi'", 0);
- check_equals(mo, varName2, "'Hi'", 0);
- check_equals(mo, "mc2.textfield._x", "150", 0);
+ check_equals(mo, "mc2.textfield.text", "'Hi'");
+ check_equals(mo, varName2, "'Hi'");
+ check_equals(mo, "mc2.textfield._x", "150");
snprintf(tmp, 1024, "'%s'", varName2);
- check_equals(mo, "mc2.textfield.variable", tmp, 0);
+ check_equals(mo, "mc2.textfield.variable", tmp);
SWFMovie_nextFrame(mo); /* showFrame */
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);
+ check_equals(mo, "mc1.textfield.text", "'World'");
+ check_equals(mo, varName1, "'World'");
+ check_equals(mo, "mc1.textfield._x", "0");
set_text(mo, "There", varName2);
shift_horizontally(mo, varName2, 10);
- check_equals(mo, "mc2.textfield.text", "'There'", 0);
- check_equals(mo, varName2, "'There'", 0);
- check_equals(mo, "mc2.textfield._x", "150", 0);
+ check_equals(mo, "mc2.textfield.text", "'There'");
+ check_equals(mo, varName2, "'There'");
+ check_equals(mo, "mc2.textfield._x", "150");
SWFMovie_nextFrame(mo); /* showFrame */
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);
+ check_equals(mo, "mc1.textfield.text", "''");
+ check_equals(mo, varName1, "''");
+ check_equals(mo, "mc1.textfield._x", "0");
set_text(mo, "", varName2);
shift_horizontally(mo, varName2, 10);
- check_equals(mo, "mc2.textfield.text", "''", 0);
- check_equals(mo, varName2, "''", 0);
- check_equals(mo, "mc2.textfield._x", "150", 0);
+ check_equals(mo, "mc2.textfield.text", "''");
+ check_equals(mo, varName2, "''");
+ check_equals(mo, "mc2.textfield._x", "150");
SWFMovie_nextFrame(mo); /* showFrame */
}
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/ming_ut...,
Sandro Santilli <=