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


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Fri, 14 Dec 2007 05:57:47 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/12/14 05:57:47

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: runtime_vm_stack_test.c 

Log message:
        * testsuite/misc-ming.all/runtime_vm_stack_test.c: new test for
          inspecting runtime vm stack.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5168&r2=1.5169
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.170&r2=1.171
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/runtime_vm_stack_test.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5168
retrieving revision 1.5169
diff -u -b -r1.5168 -r1.5169
--- ChangeLog   13 Dec 2007 23:01:15 -0000      1.5168
+++ ChangeLog   14 Dec 2007 05:57:46 -0000      1.5169
@@ -1,3 +1,8 @@
+2007-12-14 Zou Lunkai <address@hidden>
+       
+       * testsuite/misc-ming.all/runtime_vm_stack_test.c, Makefile.am:
+         new test for inspecting runtime vm stack.
+         
 2007-12-13 Sandro Santilli <address@hidden>
 
        * server/parser/button_character_def.{cpp,h}: don't leak

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -b -r1.170 -r1.171
--- testsuite/misc-ming.all/Makefile.am 4 Dec 2007 23:45:50 -0000       1.170
+++ testsuite/misc-ming.all/Makefile.am 14 Dec 2007 05:57:47 -0000      1.171
@@ -159,6 +159,7 @@
        morph_test1 \
        morph_test1runner \
        opcode_guard_test \
+       runtime_vm_stack_test \
        $(NULL)
 
 if MING_VERSION_0_4
@@ -244,6 +245,7 @@
        DefineEditTextVariableNameTest-Runner \
        DefineEditTextVariableNameTest2-Runner \
        opcode_guard_testrunner \
+       runtime_vm_stack_testrunner \
        $(NULL)
 
 if MAKESWF_SUPPORTS_PREBUILT_CLIPS
@@ -341,6 +343,18 @@
        sh $< $(top_builddir) opcode_guard_test.swf > $@
        chmod 755 $@
        
+runtime_vm_stack_test_SOURCES =        \
+       runtime_vm_stack_test.c \
+       $(NULL)
+runtime_vm_stack_test_LDADD = libgnashmingutils.la
+
+runtime_vm_stack_test.swf: runtime_vm_stack_test
+       ./runtime_vm_stack_test $(top_srcdir)/testsuite/media
+
+runtime_vm_stack_testrunner: $(srcdir)/../generic-testrunner.sh 
runtime_vm_stack_test.swf
+       sh $< $(top_builddir) runtime_vm_stack_test.swf > $@
+       chmod 755 $@
+       
 PlaceObject2Test_SOURCES =     \
        PlaceObject2Test.c      \
        $(NULL)
@@ -1684,6 +1698,7 @@
        morph_test1runner \
        registerClassTest2runner \
        opcode_guard_testrunner \
+       runtime_vm_stack_testrunner \
        $(NULL)
 
 if MING_VERSION_0_4

Index: testsuite/misc-ming.all/runtime_vm_stack_test.c
===================================================================
RCS file: testsuite/misc-ming.all/runtime_vm_stack_test.c
diff -N testsuite/misc-ming.all/runtime_vm_stack_test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/runtime_vm_stack_test.c     14 Dec 2007 05:57:47 
-0000      1.1
@@ -0,0 +1,137 @@
+/* 
+ *   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 3 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
+ *
+ */ 
+
+/*
+ *
+ * observed behaviour:
+ *   (1) different timelines still share the same vm stack
+ *   (2) vm stack should be cleared at frame boundary
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "runtime_vm_stack_test.swf"
+
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc1, mc11, mc2, dejagnuclip;
+  SWFDisplayItem it1, it2;
+  
+  const char *srcdir=".";
+  if ( argc>1 ) 
+    srcdir=argv[1];
+  else
+  {
+      fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+      return 1;
+  }
+
+  Ming_init();
+  mo = newSWFMovieWithVersion(OUTPUT_VERSION);
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate (mo, 12.0);
+  
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, "testvar1 = 0; testvar2 = 0; testvar3 = 0; ");
+  SWFMovie_nextFrame(mo); // frame1
+  
+
+  add_actions(mo, 
+      "asm{"
+      "   push '_root.testvar1'"
+      "};");
+  mc1 = newSWFMovieClip();
+    add_clip_actions(mc1, 
+        "asm{"
+        "   push 1"
+        "   setvariable"
+        "   push '_root.testvar2'"
+        "   push 2"
+        "};");
+    
+    mc11 = newSWFMovieClip();
+    add_clip_actions(mc11, 
+        "asm{"
+        "   setvariable"
+        "   push '_root.testvar3'"
+        "   push 3"
+        "};");
+    SWFMovieClip_nextFrame(mc11);
+    SWFMovieClip_add(mc1, (SWFBlock)mc11);   
+  SWFMovieClip_nextFrame(mc1);
+  
+  mc2 = newSWFMovieClip();
+  add_clip_actions(mc2, 
+    "asm{"
+    "   setvariable"
+    "};");
+  SWFMovieClip_nextFrame(mc2);
+  
+  // place mc1 and mc2
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1); 
+  SWFDisplayItem_setDepth(it1, 10);
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2); 
+  SWFDisplayItem_setDepth(it2, 20);
+  SWFMovie_nextFrame(mo); // frame2
+
+  xcheck_equals(mo, "testvar1", "1");
+  xcheck_equals(mo, "testvar2", "2");
+  xcheck_equals(mo, "testvar3", "3");
+  add_actions(mo, 
+    "asm{"
+    "   push 'testvar1'"
+    "   push 4"
+    "   push 'testvar2'"
+    "   push 5"
+    "   push 'testvar3'"
+    "   push 6"
+    "};");
+  SWFMovie_nextFrame(mo); // frame2
+  
+  add_actions(mo, 
+    "asm{"
+    "   setvariable"
+    "   setvariable"
+    "   setvariable"
+    "};");
+  xcheck_equals(mo, "testvar1", "1");
+  xcheck_equals(mo, "testvar2", "2");
+  xcheck_equals(mo, "testvar3", "3");
+  SWFMovie_nextFrame(mo); // frame3
+  
+  add_actions(mo, " _root.totals(6); stop(); ");
+  SWFMovie_nextFrame(mo); // frame4 
+  
+  //Output movie
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}
+




reply via email to

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