gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9725: Tweaked the generated code to


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9725: Tweaked the generated code to actually compile as some needed more imports, and some have no constructors, just static methods.
Date: Thu, 14 May 2009 18:04:05 -0600
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 9725
committer: address@hidden
branch nick: avm2
timestamp: Thu 2009-05-14 18:04:05 -0600
message:
  Tweaked the generated code to actually compile as some needed more imports, 
and some have no constructors, just static methods.
added:
  testsuite/as3/classes.all/media/media.am
modified:
  testsuite/as3/classes.all/media/Camera_as3.hx
  testsuite/as3/classes.all/media/ID3Info_as3.hx
  testsuite/as3/classes.all/media/Microphone_as3.hx
  testsuite/as3/classes.all/media/SoundChannel_as3.hx
  testsuite/as3/classes.all/media/SoundLoaderContext_as3.hx
  testsuite/as3/classes.all/media/SoundMixer_as3.hx
  testsuite/as3/classes.all/media/SoundTransform_as3.hx
  testsuite/as3/classes.all/media/Sound_as3.hx
  testsuite/as3/classes.all/media/Video_as3.hx
=== modified file 'testsuite/as3/classes.all/media/Camera_as3.hx'
--- a/testsuite/as3/classes.all/media/Camera_as3.hx     2009-05-03 15:49:20 
+0000
+++ b/testsuite/as3/classes.all/media/Camera_as3.hx     2009-05-15 00:04:05 
+0000
@@ -23,19 +23,24 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.Camera;
 import flash.display.MovieClip;
+#else
+import flash.Camera;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_Camera {
+class Camera_as3 {
     static function main() {
-        var x1:Camera = new Camera();
-
+        var x1:Camera = Camera.getCamera();
+        
         // Make sure we actually get a valid class        
         if (x1 != null) {
             DejaGnu.pass("Camera class exists");
@@ -105,11 +110,12 @@
        } else {
            DejaGnu.fail("Camera::name property doesn't exist");
        }
-       if (x1.names == 0) {
-           DejaGnu.pass("Camera::names property exists");
-       } else {
-           DejaGnu.fail("Camera::names property doesn't exist");
-       }
+// FIXME: this returns an array
+//     if (x1.names == 0) {
+//         DejaGnu.pass("Camera::names property exists");
+//     } else {
+//         DejaGnu.fail("Camera::names property doesn't exist");
+//     }
        if (x1.quality == 0) {
            DejaGnu.pass("Camera::quality property exists");
        } else {
@@ -124,46 +130,11 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.addEventListener == null) {
-           DejaGnu.pass("Camera::addEventListener() method exists");
-       } else {
-           DejaGnu.fail("Camera::addEventListener() method doesn't exist");
-       }
-       if (x1.dispatchEvent == false) {
-           DejaGnu.pass("Camera::dispatchEvent() method exists");
-       } else {
-           DejaGnu.fail("Camera::dispatchEvent() method doesn't exist");
-       }
-       if (x1.getCamera == Camera) {
-           DejaGnu.pass("Camera::getCamera() method exists");
-       } else {
-           DejaGnu.fail("Camera::getCamera() method doesn't exist");
-       }
-       if (x1.hasEventListener == false) {
-           DejaGnu.pass("Camera::hasEventListener() method exists");
-       } else {
-           DejaGnu.fail("Camera::hasEventListener() method doesn't exist");
-       }
-       if (x1.hasOwnProperty == false) {
-           DejaGnu.pass("Camera::hasOwnProperty() method exists");
-       } else {
-           DejaGnu.fail("Camera::hasOwnProperty() method doesn't exist");
-       }
-       if (x1.isPrototypeOf == false) {
-           DejaGnu.pass("Camera::isPrototypeOf() method exists");
-       } else {
-           DejaGnu.fail("Camera::isPrototypeOf() method doesn't exist");
-       }
-       if (x1.propertyIsEnumerable == false) {
-           DejaGnu.pass("Camera::propertyIsEnumerable() method exists");
-       } else {
-           DejaGnu.fail("Camera::propertyIsEnumerable() method doesn't exist");
-       }
-       if (x1.removeEventListener == null) {
-           DejaGnu.pass("Camera::removeEventListener() method exists");
-       } else {
-           DejaGnu.fail("Camera::removeEventListener() method doesn't exist");
-       }
+//     if (flash.media.Camera.getCamera() == Camera) {
+//         DejaGnu.pass("Camera::getCamera() method exists");
+//     } else {
+//         DejaGnu.fail("Camera::getCamera() method doesn't exist");
+//     }
        if (x1.setKeyFrameInterval == null) {
            DejaGnu.pass("Camera::setKeyFrameInterval() method exists");
        } else {
@@ -184,31 +155,11 @@
        } else {
            DejaGnu.fail("Camera::setMotionLevel() method doesn't exist");
        }
-       if (x1.setPropertyIsEnumerable == null) {
-           DejaGnu.pass("Camera::setPropertyIsEnumerable() method exists");
-       } else {
-           DejaGnu.fail("Camera::setPropertyIsEnumerable() method doesn't 
exist");
-       }
        if (x1.setQuality == null) {
            DejaGnu.pass("Camera::setQuality() method exists");
        } else {
            DejaGnu.fail("Camera::setQuality() method doesn't exist");
        }
-       if (x1.toString == null) {
-           DejaGnu.pass("Camera::toString() method exists");
-       } else {
-           DejaGnu.fail("Camera::toString() method doesn't exist");
-       }
-       if (x1.valueOf == Object) {
-           DejaGnu.pass("Camera::valueOf() method exists");
-       } else {
-           DejaGnu.fail("Camera::valueOf() method doesn't exist");
-       }
-       if (x1.willTrigger == false) {
-           DejaGnu.pass("Camera::willTrigger() method exists");
-       } else {
-           DejaGnu.fail("Camera::willTrigger() method doesn't exist");
-       }
 
         // Call this after finishing all tests. It prints out the totals.
         DejaGnu.done();

=== modified file 'testsuite/as3/classes.all/media/ID3Info_as3.hx'
--- a/testsuite/as3/classes.all/media/ID3Info_as3.hx    2009-05-03 15:49:20 
+0000
+++ b/testsuite/as3/classes.all/media/ID3Info_as3.hx    2009-05-15 00:04:05 
+0000
@@ -23,16 +23,21 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.ID3Info;
 import flash.display.MovieClip;
+#else
+import flash.ID3Info;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_ID3Info {
+class ID3Info_as3 {
     static function main() {
         var x1:ID3Info = new ID3Info();
 
@@ -82,6 +87,11 @@
        }
 
        if (x1.album == null) {
+           DejaGnu.pass("ID3Info::album property exists");
+       } else {
+           DejaGnu.fail("ID3Info::album property doesn't exist");
+       }
+
         // Call this after finishing all tests. It prints out the totals.
         DejaGnu.done();
     }

=== modified file 'testsuite/as3/classes.all/media/Microphone_as3.hx'
--- a/testsuite/as3/classes.all/media/Microphone_as3.hx 2009-05-03 15:49:20 
+0000
+++ b/testsuite/as3/classes.all/media/Microphone_as3.hx 2009-05-15 00:04:05 
+0000
@@ -23,18 +23,27 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.Microphone;
+import flash.media.SoundTransform;
 import flash.display.MovieClip;
+#else
+import flash.Microphone;
+import flash.MovieClip;
+import flash.SoundTransform;
+#end
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_Microphone {
+class Microphone_as3 {
     static function main() {
-        var x1:Microphone = new Microphone();
+        // MicroPhone doesn't have a constructor, instead it must be
+        // accessed through a static method.
+        var x1:Microphone = Microphone.getMicrophone();
 
         // Make sure we actually get a valid class        
         if (x1 != null) {
@@ -70,11 +79,12 @@
        } else {
            DejaGnu.fail("Microphone::name property doesn't exist");
        }
-       if (x1.names == 0) {
-           DejaGnu.pass("Microphone::names property exists");
-       } else {
-           DejaGnu.fail("Microphone::names property doesn't exist");
-       }
+// FIXME: this returns an array
+//     if (x1.names == 0) {
+//         DejaGnu.pass("Microphone::names property exists");
+//     } else {
+//         DejaGnu.fail("Microphone::names property doesn't exist");
+//     }
        if (x1.rate == 0) {
            DejaGnu.pass("Microphone::rate property exists");
        } else {
@@ -104,11 +114,6 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.getMicrophone == Microphone) {
-           DejaGnu.pass("Microphone::getMicrophone() method exists");
-       } else {
-           DejaGnu.fail("Microphone::getMicrophone() method doesn't exist");
-       }
        if (x1.setLoopBack == null) {
            DejaGnu.pass("Microphone::setLoopBack() method exists");
        } else {

=== modified file 'testsuite/as3/classes.all/media/SoundChannel_as3.hx'
--- a/testsuite/as3/classes.all/media/SoundChannel_as3.hx       2009-05-03 
15:49:20 +0000
+++ b/testsuite/as3/classes.all/media/SoundChannel_as3.hx       2009-05-15 
00:04:05 +0000
@@ -23,16 +23,17 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
 import flash.media.SoundChannel;
+import flash.media.SoundTransform;
 import flash.display.MovieClip;
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_SoundChannel {
+class SoundChannel_as3 {
     static function main() {
         var x1:SoundChannel = new SoundChannel();
 

=== modified file 'testsuite/as3/classes.all/media/SoundLoaderContext_as3.hx'
--- a/testsuite/as3/classes.all/media/SoundLoaderContext_as3.hx 2009-05-03 
15:49:20 +0000
+++ b/testsuite/as3/classes.all/media/SoundLoaderContext_as3.hx 2009-05-15 
00:04:05 +0000
@@ -23,16 +23,16 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
 import flash.media.SoundLoaderContext;
 import flash.display.MovieClip;
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_SoundLoaderContext {
+class SoundLoaderContext_as3 {
     static function main() {
         var x1:SoundLoaderContext = new SoundLoaderContext();
 
@@ -59,11 +59,11 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.SoundLoaderContext == false) {
-           DejaGnu.pass("SoundLoaderContext::SoundLoaderContext() method 
exists");
-       } else {
-           DejaGnu.fail("SoundLoaderContext::SoundLoaderContext() method 
doesn't exist");
-       }
+//     if (x1.SoundLoaderContext == false) {
+//         DejaGnu.pass("SoundLoaderContext::SoundLoaderContext() method 
exists");
+//     } else {
+//         DejaGnu.fail("SoundLoaderContext::SoundLoaderContext() method 
doesn't exist");
+//     }
 
         // Call this after finishing all tests. It prints out the totals.
         DejaGnu.done();

=== modified file 'testsuite/as3/classes.all/media/SoundMixer_as3.hx'
--- a/testsuite/as3/classes.all/media/SoundMixer_as3.hx 2009-05-03 15:49:20 
+0000
+++ b/testsuite/as3/classes.all/media/SoundMixer_as3.hx 2009-05-15 00:04:05 
+0000
@@ -23,34 +23,32 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.SoundMixer;
+import flash.media.SoundTransform;
 import flash.display.MovieClip;
+#else
+import flash.SoundMixer;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_SoundMixer {
+class SoundMixer_as3 {
     static function main() {
-        var x1:SoundMixer = new SoundMixer();
 
-        // Make sure we actually get a valid class        
-        if (x1 != null) {
-            DejaGnu.pass("SoundMixer class exists");
-        } else {
-            DejaGnu.fail("SoundMixer lass doesn't exist");
-        }
+    // SoundMixer doesn't contain a constructor, all it's methods are static
 // Tests to see if all the properties exist. All these do is test for
 // existance of a property, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.bufferTime == 0) {
+       if (SoundMixer.bufferTime == 0) {
            DejaGnu.pass("SoundMixer::bufferTime property exists");
        } else {
            DejaGnu.fail("SoundMixer::bufferTime property doesn't exist");
        }
-       if (x1.soundTransform == SoundTransform) {
+       if (SoundMixer.soundTransform == SoundTransform) {
            DejaGnu.pass("SoundMixer::soundTransform property exists");
        } else {
            DejaGnu.fail("SoundMixer::soundTransform property doesn't exist");
@@ -59,17 +57,17 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.areSoundsInaccessible == false) {
+       if (SoundMixer.areSoundsInaccessible == null) {
            DejaGnu.pass("SoundMixer::areSoundsInaccessible() method exists");
        } else {
            DejaGnu.fail("SoundMixer::areSoundsInaccessible() method doesn't 
exist");
        }
-       if (x1.computeSpectrum == null) {
+       if (SoundMixer.computeSpectrum == null) {
            DejaGnu.pass("SoundMixer::computeSpectrum() method exists");
        } else {
            DejaGnu.fail("SoundMixer::computeSpectrum() method doesn't exist");
        }
-       if (x1.stopAll == null) {
+       if (SoundMixer.stopAll == null) {
            DejaGnu.pass("SoundMixer::stopAll() method exists");
        } else {
            DejaGnu.fail("SoundMixer::stopAll() method doesn't exist");

=== modified file 'testsuite/as3/classes.all/media/SoundTransform_as3.hx'
--- a/testsuite/as3/classes.all/media/SoundTransform_as3.hx     2009-05-03 
15:49:20 +0000
+++ b/testsuite/as3/classes.all/media/SoundTransform_as3.hx     2009-05-15 
00:04:05 +0000
@@ -23,16 +23,22 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.SoundTransform;
+import flash.media.SoundChannel;
 import flash.display.MovieClip;
+#else
+import flash.SoundTransform;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 
+import DejaGnu;
+
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_SoundTransform {
+class SoundTransform_as3 {
     static function main() {
         var x1:SoundTransform = new SoundTransform();
 
@@ -79,11 +85,11 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.SoundTransform == 0) {
-           DejaGnu.pass("SoundTransform::SoundTransform() method exists");
-       } else {
-           DejaGnu.fail("SoundTransform::SoundTransform() method doesn't 
exist");
-       }
+//     if (x1.SoundTransform == 0) {
+//         DejaGnu.pass("SoundTransform::SoundTransform() method exists");
+//     } else {
+//         DejaGnu.fail("SoundTransform::SoundTransform() method doesn't 
exist");
+//     }
 
         // Call this after finishing all tests. It prints out the totals.
         DejaGnu.done();

=== modified file 'testsuite/as3/classes.all/media/Sound_as3.hx'
--- a/testsuite/as3/classes.all/media/Sound_as3.hx      2009-05-14 22:24:54 
+0000
+++ b/testsuite/as3/classes.all/media/Sound_as3.hx      2009-05-15 00:04:05 
+0000
@@ -23,11 +23,19 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
+#if flash9
 import flash.media.ID3Info;
 import flash.media.Sound;
 import flash.media.SoundLoaderContext;
 import flash.media.SoundChannel;
 import flash.display.MovieClip;
+#else
+import flash.ID3Info;
+import flash.Sound;
+import flash.SoundLoaderContext;
+import flash.SoundChannel;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 

=== modified file 'testsuite/as3/classes.all/media/Video_as3.hx'
--- a/testsuite/as3/classes.all/media/Video_as3.hx      2009-05-03 15:49:20 
+0000
+++ b/testsuite/as3/classes.all/media/Video_as3.hx      2009-05-15 00:04:05 
+0000
@@ -23,16 +23,19 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#include "DejaGnu.hx"
-
+#if flash9
 import flash.media.Video;
 import flash.display.MovieClip;
+#else
+import flash.Video;
+import flash.MovieClip;
+#end
 import flash.Lib;
 import Type;
 
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
-class PP_Video {
+class Video_as3 {
     static function main() {
         var x1:Video = new Video();
 
@@ -69,11 +72,6 @@
 // Tests to see if all the methods exist. All these do is test for
 // existance of a method, and don't test the functionality at all. This
 // is primarily useful only to test completeness of the API implementation.
-       if (x1.Video == 0) {
-           DejaGnu.pass("Video::Video() method exists");
-       } else {
-           DejaGnu.fail("Video::Video() method doesn't exist");
-       }
        if (x1.attachCamera == null) {
            DejaGnu.pass("Video::attachCamera() method exists");
        } else {

=== added file 'testsuite/as3/classes.all/media/media.am'
--- a/testsuite/as3/classes.all/media/media.am  1970-01-01 00:00:00 +0000
+++ b/testsuite/as3/classes.all/media/media.am  2009-05-15 00:04:05 +0000
@@ -0,0 +1,62 @@
+## Process this file with automake to generate Makefile.in
+# 
+#   Copyright (C) 2005, 2006, 2007, 2008, 2009 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
+
+MEDIAdir = $(srcdir)/media
+
+#AM_CPPFLAGS += -I$(MEDIAdir)
+
+MEDIA_TESTS = 
+
+if BUILD_CAMERA_AS3
+MEDIA_TESTS += media/Camera_as3.swf
+endif
+
+if BUILD_ID3INFO_AS3
+MEDIA_TESTS += media/ID3Info_as3.swf
+endif
+
+if BUILD_MICROPHONE_AS3
+MEDIA_TESTS += media/Microphone_as3.swf
+endif
+
+if BUILD_SOUNDCHANNEL_AS3
+MEDIA_TESTS += media/SoundChannel_as3.swf
+endif
+
+if BUILD_SOUNDLOADERCONTEXT_AS3
+MEDIA_TESTS += media/SoundLoaderContext_as3.swf
+endif
+
+if BUILD_SOUNDMIXER_AS3
+MEDIA_TESTS += media/SoundMixer_as3.swf
+endif
+
+if BUILD_SOUNDTRANSFORM_AS3
+MEDIA_TESTS += media/SoundTransform_as3.swf
+endif
+
+if BUILD_SOUND_AS3
+MEDIA_TESTS += media/Sound_as3.swf
+endif
+
+if BUILD_VIDEO_AS3
+MEDIA_TESTS += media/Video_as3.swf
+endif
+
+check_SCRIPTS += $(MEDIA_TESTS)
+HAXE_FLAGS += -cp $(MEDIAdir)
+


reply via email to

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