gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11166: Fixes to tests, new test (wi


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11166: Fixes to tests, new test (without runner) for AVM2 behaviour.
Date: Thu, 25 Jun 2009 09:39:48 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11166
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-06-25 09:39:48 +0200
message:
  Fixes to tests, new test (without runner) for AVM2 behaviour.
added:
  testsuite/misc-swfmill.all/scope1.xml
modified:
  libcore/as_object.cpp
  testsuite/as3compile.all/lookup.as
  testsuite/misc-swfmill.all/Makefile.am
    ------------------------------------------------------------
    revno: 11163.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-06-24 08:10:35 +0200
    message:
      Spaces.
    modified:
      libcore/as_object.cpp
    ------------------------------------------------------------
    revno: 11163.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-06-24 08:12:45 +0200
    message:
      Minor cleanups.
    modified:
      libcore/as_object.cpp
    ------------------------------------------------------------
    revno: 11163.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2009-06-24 08:17:10 +0200
    message:
      Empty line.
    modified:
      libcore/as_object.cpp
    ------------------------------------------------------------
    revno: 11163.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2009-06-25 09:29:28 +0200
    message:
      Add a low-level test for stack and scope stack behaviour with function
      calls.
    added:
      testsuite/misc-swfmill.all/scope1.xml
    ------------------------------------------------------------
    revno: 11163.1.5
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2009-06-25 09:30:46 +0200
    message:
      Run the correct test for as3.
    modified:
      testsuite/misc-swfmill.all/Makefile.am
    ------------------------------------------------------------
    revno: 11163.1.6
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2009-06-25 09:33:15 +0200
    message:
      Use public classes in packages, fixing a compile failure for earlier
      versions of as3compile.
    modified:
      testsuite/as3compile.all/lookup.as
=== modified file 'libcore/as_object.cpp'
--- a/libcore/as_object.cpp     2009-06-16 11:18:35 +0000
+++ b/libcore/as_object.cpp     2009-06-24 06:17:10 +0000
@@ -559,12 +559,10 @@
 as_object::get_member_slot(int order, as_value* val){
        
        const Property* prop = _members.getPropertyByOrder(order);
-       if(prop){
+       if (prop) {
                return get_member(prop->getName(), val, prop->getNamespace());
        }
-       else{
-               return false;
-       }
+    return false;
 }
 
 
@@ -572,12 +570,10 @@
 as_object::set_member_slot(int order, const as_value& val, bool ifFound)
 {
        const Property* prop = _members.getPropertyByOrder(order);
-       if(prop){
+       if (prop) {
                return set_member(prop->getName(), val, prop->getNamespace(), 
ifFound);
        }
-       else{
-               return false;
-       }
+    return false;
 }
 
 // Handles read_only and static properties properly.

=== modified file 'testsuite/as3compile.all/lookup.as'
--- a/testsuite/as3compile.all/lookup.as        2009-06-18 08:38:16 +0000
+++ b/testsuite/as3compile.all/lookup.as        2009-06-25 07:33:15 +0000
@@ -18,14 +18,14 @@
 #include "check.as"
 
 package p1 {
-    class A { public function id() { return "p1.A"; } }
-    class B { public static function id() { return "p1.B"; } }
+    public class A { public function id() { return "p1.A"; } }
+    public class B { public static function id() { return "p1.B"; } }
 }
 
 package p2 {
-    class A { public function id() { return "p2.A"; } }
-    class B { public static function id() { return "p2.B"; } }
-    class C {}
+    public class A { public function id() { return "p2.A"; } }
+    public class B { public static function id() { return "p2.B"; } }
+    public class C {}
 }
 
 import flash.display.MovieClip;

=== modified file 'testsuite/misc-swfmill.all/Makefile.am'
--- a/testsuite/misc-swfmill.all/Makefile.am    2009-06-23 12:16:54 +0000
+++ b/testsuite/misc-swfmill.all/Makefile.am    2009-06-25 07:30:46 +0000
@@ -36,7 +36,7 @@
        $(NULL)
 
 SC_AS3_XMLTEXTS = \
-       mixed-bytecode-as2.xml  \
+       mixed-bytecode-as3.xml  \
        $(NULL)
 
 EXTRA_DIST = $(SC_AS2_XMLTESTS) $(SC_AS3_XMLTESTS)  

=== added file 'testsuite/misc-swfmill.all/scope1.xml'
--- a/testsuite/misc-swfmill.all/scope1.xml     1970-01-01 00:00:00 +0000
+++ b/testsuite/misc-swfmill.all/scope1.xml     2009-06-25 07:29:28 +0000
@@ -0,0 +1,277 @@
+<?xml version="1.0"?>
+<swf version="9" compressed="1">
+  <Header framerate="25" frames="1">
+    <size>
+      <Rectangle left="0" right="8000" top="0" bottom="6000"/>
+    </size>
+    <tags>
+      <FileAttributes hasMetaData="0" allowABC="1" 
suppressCrossDomainCaching="0" swfRelativeURLs="0" useNetwork="0"/>
+      <DoABCDefine flags="0" name="">
+        <actions>
+          <Action3 minorVersion="16" majorVersion="46">
+            <constants>
+              <Constants>
+                <ints/>
+                <uints/>
+                <doubles/>
+                <strings>
+                  <String2 value="A.f()"/>
+                  <String2 value="A"/>
+                  <String2 value="MovieClip"/>
+                  <String2 value="f"/>
+                  <String2 value="Object"/>
+                  <String2 value="EventDispatcher"/>
+                  <String2 value="DisplayObject"/>
+                  <String2 value="InteractiveObject"/>
+                  <String2 value="DisplayObjectContainer"/>
+                  <String2 value="Sprite"/>
+                  <String2 value="trace"/>
+                  <String2 value="a"/>
+                  <String2 value="flash.display"/>
+                  <String2 value=""/>
+                  <String2 value="flash.events"/>
+                </strings>
+                <namespaces>
+                  <ProtectedNamespace index="2"/>
+                  <PackageNamespace index="12"/>
+                  <PackageNamespace index="13"/>
+                  <PackageNamespace index="14"/>
+                  <PackageNamespace index="15"/>
+                </namespaces>
+                <namespaceSets/>
+                <multinames>
+                  <QName namespaceIndex="2" nameIndex="2"/>
+                  <QName namespaceIndex="3" nameIndex="3"/>
+                  <QName namespaceIndex="4" nameIndex="4"/>
+                  <QName namespaceIndex="4" nameIndex="5"/>
+                  <QName namespaceIndex="5" nameIndex="6"/>
+                  <QName namespaceIndex="3" nameIndex="7"/>
+                  <QName namespaceIndex="3" nameIndex="8"/>
+                  <QName namespaceIndex="3" nameIndex="9"/>
+                  <QName namespaceIndex="3" nameIndex="10"/>
+                  <QName namespaceIndex="4" nameIndex="11"/>
+                </multinames>
+              </Constants>
+            </constants>
+            <methods>
+              <MethodInfo retType="0" nameIndex="0" hasParamNames="0" 
setSDXNs="0" isExplicit="0" ignoreRest="0" hasOptional="0" needRest="0" 
needActivation="0" needArguments="0">
+                <paramTypes/>
+              </MethodInfo>
+              <MethodInfo retType="0" nameIndex="0" hasParamNames="0" 
setSDXNs="0" isExplicit="0" ignoreRest="0" hasOptional="0" needRest="0" 
needActivation="0" needArguments="0">
+                <paramTypes/>
+              </MethodInfo>
+              <MethodInfo retType="0" nameIndex="0" hasParamNames="0" 
setSDXNs="0" isExplicit="0" ignoreRest="0" hasOptional="0" needRest="0" 
needActivation="0" needArguments="0">
+                <paramTypes/>
+              </MethodInfo>
+              <MethodInfo retType="0" nameIndex="0" hasParamNames="0" 
setSDXNs="0" isExplicit="0" ignoreRest="0" hasOptional="0" needRest="0" 
needActivation="0" needArguments="0">
+                <paramTypes/>
+              </MethodInfo>
+            </methods>
+            <metadata/>
+            <instances>
+              <InstanceInfo nameIndex="1" superIndex="2" hasProtectedNS="1" 
interface="0" final="0" sealed="1" protectedNS="1" iInitIndex="2">
+                <interfaces/>
+                <traits>
+                  <TraitInfo nameIndex="3" override="0" final="0">
+                    <trait>
+                      <Method dispID="1" methodInfo="1"/>
+                    </trait>
+                  </TraitInfo>
+                </traits>
+              </InstanceInfo>
+            </instances>
+            <classes>
+              <ClassInfo cInitIndex="3">
+                <traits/>
+              </ClassInfo>
+            </classes>
+            <scripts>
+              <ScriptInfo initIndex="0">
+                <traits>
+                  <TraitInfo nameIndex="1" override="0" final="0">
+                    <trait>
+                      <Class slotID="1" classInfo="0"/>
+                    </trait>
+                  </TraitInfo>
+                </traits>
+              </ScriptInfo>
+            </scripts>
+            <methodBodies>
+              <MethodBody methodInfo="0" maxStack="3" maxRegs="1" 
scopeDepth="0" maxScope="8" exceptionCount="0">
+                <code>
+                  <OpGetLocal0/>
+                  <OpPushScope/>
+                  <OpGetGlobalScope/>
+                  <OpGetLex name="2"/>
+                  <OpDup/>
+                  <OpPushScope/>
+                  <OpNewClass classIndex="0"/>
+                  <OpPopScope/>
+                  <OpSetSlot slotID="1"/>
+                  <OpReturnVoid/>
+                </code>
+                <exceptions/>
+                <traits/>
+              </MethodBody>
+
+             <!-- This is function A.f() -->
+             <!--
+             Its purpose is to push things onto the stack and the scope
+             stack and leave them there to see whether they are still
+             available after return.
+             Ideally we would also verify that the stack and the scope stack
+             from before this function call are not available, but this causes
+             VerifyErrors that interrupt execution.
+             -->
+              <MethodBody methodInfo="1" maxStack="8" maxRegs="1" 
scopeDepth="5" maxScope="14" exceptionCount="0">
+               <code>
+
+                 <!-- This seems accepted by the player, but has no effect -->
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+                 <OpPopStack/>
+
+                 <!-- OpPopScope, on the other hand, causes a scope stack
+                 underflow error, so we don't do it. -->
+
+                  <OpFindPropStrict name="10"/>
+                  <OpPushString index="1"/>
+                 <OpCallPropVoid name="10" argc="1"/>
+
+                 <!-- Push junk to the stack -->
+                 <OpPushByte value="9"/>
+                 <OpPushByte value="9"/>
+                 <OpPushByte value="9"/>
+                 <OpPushByte value="9"/>
+                 <OpPushByte value="9"/>
+                 
+                 <!-- Push junk to the scope stack (first A.A, then
+                 4 Sprite classes) -->
+                  <OpGetLocal0/>
+                 <OpPushScope/>
+                 <OpGetGlobalScope/>
+                 <OpGetLex name="9"/>
+                 <OpPushScope/>
+                 <OpGetLex name="9"/>
+                 <OpPushScope/>
+                 <OpGetLex name="9"/>
+                 <OpPushScope/>
+                 <OpGetLex name="9"/>
+                 <OpPushScope/>
+
+                 <!-- Check that the junk is there -->
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="0"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="1"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="2"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="3"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="4"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 <!-- scopeIndex 5 causes a VerifyError (out of bounds),
+                 so the scope stack from before the call is not available. -->
+
+                 <OpReturnVoid/>
+                </code>
+                <exceptions/>
+                <traits/>
+              </MethodBody>
+              <MethodBody methodInfo="2" maxStack="10" maxRegs="1" 
scopeDepth="8" maxScope="12" exceptionCount="0">
+                <code>
+                  <OpGetLocal0/>
+                  <OpConstructSuper argc="0"/>
+                 
+                 <!-- Push stuff to the scope stack (A.A then three 
+                 EventDispatcher classes) -->
+                  <OpGetLocal0/>
+                 <OpPushScope/>
+                 <OpGetGlobalScope/>
+                 <OpGetLex name="5"/>
+                 <OpPushScope/>
+                 <OpGetLex name="5"/>
+                 <OpPushScope/>
+                 <OpGetLex name="5"/>
+                 <OpPushScope/>
+
+                 <!-- Push 3 values, 3 trace function lookups to the stack -->
+                 <OpFindPropStrict name="10"/>
+                 <OpPushByte value="1"/>       
+                 <OpFindPropStrict name="10"/>
+                 <OpPushByte value="2"/>       
+                 <OpFindPropStrict name="10"/>
+                 <OpPushByte value="3"/>       
+                 
+                 <!-- This is one call to trace() -->
+                 <OpCallPropVoid name="10" argc="1"/>
+                 
+                 <!-- This is the call to f() -->
+                 <!-- f() pushes things to the stack and scope stack, 
+                 and leaves them there. They should not be available after
+                 the function call has finished, but what was on the stacks
+                 before the call should still be there. -->
+                  <OpGetLocal0/>
+                 <OpCallPropVoid name="3" argc="0"/>
+                 
+                 <!-- These are the remaining calls to trace() -->
+                  <OpCallPropVoid name="10" argc="1"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+
+                 <!-- Now trace what's on the scope stack -->
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="0"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="1"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="2"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 
+                 <OpFindPropStrict name="10"/>
+                 <OpGetScopeObject scopeIndex="3"/>
+                  <OpCallPropVoid name="10" argc="1"/>
+                 
+                 <OpReturnVoid/>
+                </code>
+                <exceptions/>
+                <traits/>
+              </MethodBody>
+              <MethodBody methodInfo="3" maxStack="1" maxRegs="1" 
scopeDepth="8" maxScope="9" exceptionCount="0">
+                <code>
+                  <OpGetLocal0/>
+                  <OpPushScope/>
+                  <OpReturnVoid/>
+                </code>
+                <exceptions/>
+                <traits/>
+              </MethodBody>
+            </methodBodies>
+          </Action3>
+        </actions>
+      </DoABCDefine>
+      <SymbolClass>
+        <symbols>
+          <Symbol objectID="0" name="a.A"/>
+        </symbols>
+      </SymbolClass>
+      <ShowFrame/>
+      <End/>
+    </tags>
+  </Header>
+</swf>


reply via email to

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