gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash/testsuite/misc-ming.all DefineEditTextVar...
Date: Wed, 20 Sep 2006 16:50:33 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/09/20 16:50:33

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

Log message:
        cleanup of the testcase

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c?cvsroot=gnash&r1=1.1&r2=1.2

Patches:
Index: DefineEditTextVariableNameTest.c
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/DefineEditTextVariableNameTest.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- DefineEditTextVariableNameTest.c    20 Sep 2006 16:20:39 -0000      1.1
+++ DefineEditTextVariableNameTest.c    20 Sep 2006 16:50:33 -0000      1.2
@@ -39,7 +39,8 @@
  * Test DefineEditText tag with VariableName
  * Uses "embedded" font with chars: "Hello world"
  * Then, every second it toggles the text between "Hello"
- * and "World" by accessing the VariableName
+ * and "World" by accessing the VariableName. After every
+ * variable set it also traces the value of the VariableName.
  *
  * run as ./DefineEditTextVariableNameTest
  */
@@ -109,6 +110,12 @@
         *
         *********************************************/
 
+       /* 
+        * The variable name
+        */
+       char* varName = "testName";
+       char buf[256];
+
        /* This is with embedded fonts, not working */
        {
                FILE *font_file = fopen(fdbfont, "r");
@@ -119,7 +126,7 @@
                }
                /*SWFBrowserFont bfont = newSWFBrowserFont("_sans");*/
                SWFFont bfont = loadSWFFontFromFile(font_file);
-               add_text_field(mo, (SWFBlock)bfont, "testName", "Hello World");
+               add_text_field(mo, (SWFBlock)bfont, varName, "Hello World");
        }
 
        /*********************************************
@@ -130,14 +137,16 @@
 
        {
                SWFAction ac;
-               ac = compileSWFActionCode("trace(testName); testName = 
\"Hello\";");
+               sprintf(buf, "%s = \"Hello\"; trace(%s);", varName, varName);
+               ac = compileSWFActionCode(buf);
                SWFMovie_add(mo, (SWFBlock)ac);
                SWFMovie_nextFrame(mo); 
        }
 
        {
                SWFAction ac;
-               ac = compileSWFActionCode("trace(testName); testName = 
\"World\";");
+               sprintf(buf, "%s = \"World\"; trace(%s);", varName, varName);
+               ac = compileSWFActionCode(buf);
                SWFMovie_add(mo, (SWFBlock)ac);
                SWFMovie_nextFrame(mo); /* showFrame */
        }
@@ -146,7 +155,8 @@
                // testName (the variable) doesn't access the character,
                // only its text.
                SWFAction ac;
-               ac = compileSWFActionCode("testName._x += 10;");
+               sprintf(buf, "%s._x += 10;", varName);
+               ac = compileSWFActionCode(buf);
                SWFMovie_add(mo, (SWFBlock)ac);
                SWFMovie_nextFrame(mo); /* showFrame */
        }




reply via email to

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