1// SoundChannel_as.hx: ActionScript 3 "SoundChannel" class, for Gnash. 2// 3// Generated by gen-as3.sh on: 20090503 by "rob". Remove this 4// after any hand editing loosing changes. 5// 6// Copyright (C) 2009, 2010 Free Software Foundation, Inc. 7// 8// This program is free software; you can redistribute it and/or modify 9// it under the terms of the GNU General Public License as published by 10// the Free Software Foundation; either version 3 of the License, or 11// (at your option) any later version. 12// 13// This program is distributed in the hope that it will be useful, 14// but WITHOUT ANY WARRANTY; without even the implied warranty of 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16// GNU General Public License for more details. 17// 18// You should have received a copy of the GNU General Public License 19// along with this program; if not, write to the Free Software 20// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21// 22 23// This test case must be processed by CPP before compiling to include the 24// DejaGnu.hx header file for the testing framework support. 25 26#if flash9 27import flash.media.SoundChannel; 28import flash.media.SoundTransform; 29import flash.display.MovieClip; 30import flash.Lib; 31import Type; 32#end 33 34import DejaGnu; 35 36// Class must be named with the PP prefix, as that's the name the 37// file passed to haxe will have after the preprocessing step 38class SoundChannel_as { 39 static function main() { 40 #if !flash9 41 DejaGnu.note("This test is not valid for flash v < 9. Run internal ming test."); 42 #end 43 44 #if flash9 45 var x1:SoundChannel = new SoundChannel(); 46 47 // Make sure we actually get a valid class 48 if (x1 != null) { 49 DejaGnu.pass("SoundChannel class exists"); 50 } else { 51 DejaGnu.fail("SoundChannel lass doesn't exist"); 52 } 53// Tests to see if all the properties exist. All these do is test for 54// existance of a property, and don't test the functionality at all. This 55// is primarily useful only to test completeness of the API implementation. 56 if (Type.typeof(x1.leftPeak) == ValueType.TFloat) { 57 DejaGnu.pass("SoundChannel::leftPeak property exists"); 58 } else { 59 DejaGnu.fail("SoundChannel::leftPeak property doesn't exist"); 60 } 61 if (Type.typeof(x1.position) == ValueType.TFloat) { 62 DejaGnu.pass("SoundChannel::position property exists"); 63 } else { 64 DejaGnu.fail("SoundChannel::position property doesn't exist"); 65 } 66 if (Type.typeof(x1.rightPeak) == ValueType.TFloat) { 67 DejaGnu.pass("SoundChannel::rightPeak property exists"); 68 } else { 69 DejaGnu.fail("SoundChannel::rightPeak property doesn't exist"); 70 } 71 if (Type.typeof(x1.soundTransform) == ValueType.TObject) { 72 DejaGnu.pass("SoundChannel::soundTransform property exists"); 73 } else { 74 DejaGnu.fail("SoundChannel::soundTransform property doesn't exist"); 75 } 76 77// Tests to see if all the methods exist. All these do is test for 78// existance of a method, and don't test the functionality at all. This 79// is primarily useful only to test completeness of the API implementation. 80 if (Type.typeof(x1.stop) == ValueType.TFunction) { 81 DejaGnu.pass("SoundChannel::stop() method exists"); 82 } else { 83 DejaGnu.fail("SoundChannel::stop() method doesn't exist"); 84 } 85 #end 86 // Call this after finishing all tests. It prints out the totals. 87 DejaGnu.done(); 88 } 89} 90