// ByteArray_as.hx:  ActionScript 3 "ByteArray" class, for Gnash.
//
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
// after any hand editing loosing changes.
//
//   Copyright (C) 2009, 2010 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
//

// 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.utils.ByteArray;
import flash.display.MovieClip;
#end
import flash.Lib;
import Type;
import Std;

// import our testing API
import DejaGnu;

// Class must be named with the _as suffix, as that's the same name as the file.
class ByteArray_as {
    static function main() {
        #if !flash9
			DejaGnu.note("This is not applicable to this version of flash");
		#end
		#if flash9
		var x1:ByteArray = new ByteArray();

        // Make sure we actually get a valid class        
        if (x1 != null) {
            DejaGnu.pass("ByteArray class exists");
        } else {
            DejaGnu.fail("ByteArray class doesn't exist");
        }
// 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 (Std.is(x1.bytesAvailable, Float)) {
	    DejaGnu.pass("ByteArray.bytesAvailable property exists");
	} else {
	    DejaGnu.fail("ByteArray.bytesAvailable property doesn't exist");
	}
	if (Std.is(ByteArray.defaultObjectEncoding, Float)) {
	    DejaGnu.pass("ByteArray.defaultObjectEncoding property exists");
	} else {
	    DejaGnu.fail("ByteArray.defaultObjectEncoding property doesn't exist");
	}
	if (Std.is(x1.endian, String)) {
	    DejaGnu.pass("ByteArray.endian property exists");
	} else {
	    DejaGnu.fail("ByteArray.endian property doesn't exist");
	}
	if (Std.is(x1.length, Float)) {
	    DejaGnu.pass("ByteArray.length property exists");
	} else {
	    DejaGnu.fail("ByteArray.length property doesn't exist");
	}
	if (Std.is(x1.objectEncoding, Float)) {
	    DejaGnu.pass("ByteArray.objectEncoding property exists");
	} else {
	    DejaGnu.fail("ByteArray.objectEncoding property doesn't exist");
	}
	if (Std.is(x1.position, Float)) {
	    DejaGnu.pass("ByteArray.position property exists");
	} else {
	    DejaGnu.fail("ByteArray.position property doesn't exist");
	}

// 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 (Type.typeof(x1.compress) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::compress() method exists");
	} else {
	    DejaGnu.fail("ByteArray::compress() method doesn't exist");
	}
	if ((Type.typeof(x1.readBoolean) == ValueType.TFunction)) {
	    DejaGnu.pass("ByteArray::readBoolean() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readBoolean() method doesn't exist");
	}
	if (Type.typeof(x1.readByte) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readByte() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readByte() method doesn't exist");
	}
	if (Type.typeof(x1.readBytes) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readBytes() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readBytes() method doesn't exist");
	}
	if (Type.typeof(x1.readDouble) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readDouble() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readDouble() method doesn't exist");
	}
	if (Type.typeof(x1.readFloat) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readFloat() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readFloat() method doesn't exist");
	}
	if (Type.typeof(x1.readInt) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readInt() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readInt() method doesn't exist");
	}
	if (Type.typeof(x1.readMultiByte) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readMultiByte() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readMultiByte() method doesn't exist");
	}
	if (Type.typeof(x1.readObject) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readObject() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readObject() method doesn't exist");
	}
	if (Type.typeof(x1.readShort) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readShort() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readShort() method doesn't exist");
	}
	if (Type.typeof(x1.readUnsignedByte) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readUnsignedByte() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readUnsignedByte() method doesn't exist");
	}
	if (Type.typeof(x1.readUnsignedInt) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readUnsignedInt() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readUnsignedInt() method doesn't exist");
	}
	if (Type.typeof(x1.readUnsignedShort) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readUnsignedShort() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readUnsignedShort() method doesn't exist");
	}
	if (Type.typeof(x1.readUTF) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readUTF() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readUTF() method doesn't exist");
	}
	if (Type.typeof(x1.readUTFBytes) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::readUTFBytes() method exists");
	} else {
	    DejaGnu.fail("ByteArray::readUTFBytes() method doesn't exist");
	}
	if (Type.typeof(x1.toString) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::toString() method exists");
	} else {
	    DejaGnu.fail("ByteArray::toString() method doesn't exist");
	}
	if (Type.typeof(x1.uncompress) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::uncompress() method exists");
	} else {
	    DejaGnu.fail("ByteArray::uncompress() method doesn't exist");
	}
	if (Type.typeof(x1.writeBoolean) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeBoolean() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeBoolean() method doesn't exist");
	}
	if (Type.typeof(x1.writeByte) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeByte() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeByte() method doesn't exist");
	}
	if (Type.typeof(x1.writeBytes) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeBytes() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeBytes() method doesn't exist");
	}
	if (Type.typeof(x1.writeDouble) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeDouble() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeDouble() method doesn't exist");
	}
	if (Type.typeof(x1.writeFloat) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeFloat() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeFloat() method doesn't exist");
	}
	if (Type.typeof(x1.writeInt) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeInt() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeInt() method doesn't exist");
	}
	if (Type.typeof(x1.writeMultiByte) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeMultiByte() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeMultiByte() method doesn't exist");
	}
	if (Type.typeof(x1.writeObject) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeObject() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeObject() method doesn't exist");
	}
	if (Type.typeof(x1.writeShort) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeShort() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeShort() method doesn't exist");
	}
	if (Type.typeof(x1.writeUnsignedInt) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeUnsignedInt() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeUnsignedInt() method doesn't exist");
	}
	if (Type.typeof(x1.writeUTF) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeUTF() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeUTF() method doesn't exist");
	}
	if (Type.typeof(x1.writeUTFBytes) == ValueType.TFunction) {
	    DejaGnu.pass("ByteArray::writeUTFBytes() method exists");
	} else {
	    DejaGnu.fail("ByteArray::writeUTFBytes() method doesn't exist");
	}
	#end
        // Call this after finishing all tests. It prints out the totals.
        DejaGnu.done();
    }
}

// local Variables:
// mode: C++
// indent-tabs-mode: t
// End:

