// ID3Info_as.hx:  ActionScript 3 "ID3Info" class, for Gnash.
//
// Generated by gen-as3.sh on: 20090503 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.

// NOTE: the ID3 reader tag class was only implemented for flash 9 and
// above so this test is only valid for said versions.

#if flash9
import flash.media.ID3Info;
import flash.display.MovieClip;
import flash.Lib;
#end
import Type;
import Std;
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 ID3Info_as {
    static function main() {
        #if flash9
		var x1:ID3Info = new ID3Info();

        // Make sure we actually get a valid class        
        if (x1 != null) {
            DejaGnu.pass("ID3Info class exists");
        } else {
            DejaGnu.fail("ID3Info lass 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.
	//FIXME: these all should make sure that the class can handle attempted
	// buffer overflow attacks in ID3 tags (parse the string)
	if (Std.is(x1.album, String)) {
	    DejaGnu.pass("ID3Info::album property exists");
	} else {
	    DejaGnu.fail("ID3Info::album property doesn't exist");
	}
	if (Std.is(x1.artist, String)) {
	    DejaGnu.pass("ID3Info::artist property exists");
	} else {
	    DejaGnu.fail("ID3Info::artist property doesn't exist");
	}
	if (Std.is(x1.comment, String)) {
	    DejaGnu.pass("ID3Info::comment property exists");
	} else {
	    DejaGnu.fail("ID3Info::comment property doesn't exist");
	}
	if (Std.is(x1.genre, String)) {
	    DejaGnu.pass("ID3Info::genre property exists");
	} else {
	    DejaGnu.fail("ID3Info::genre property doesn't exist");
	}
	if (Std.is(x1.songName, String)) {
	    DejaGnu.pass("ID3Info::songName property exists");
	} else {
	    DejaGnu.fail("ID3Info::songName property doesn't exist");
	}
	if (Std.is(x1.track, String)) {
	    DejaGnu.pass("ID3Info::track property exists");
	} else {
	    DejaGnu.fail("ID3Info::track property doesn't exist");
	}
	if (Std.is(x1.year, String)) {
	    DejaGnu.pass("ID3Info::year property exists");
	} else {
	    DejaGnu.fail("ID3Info::year property doesn't exist");
	}

	if (Std.is(x1.album, String)) {
	    DejaGnu.pass("ID3Info::album property exists");
	} else {
	    DejaGnu.fail("ID3Info::album property doesn't exist");
	}
#end
#if !flash9
	DejaGnu.note("This test is only valid for flashv9 and above. run the ming test");
#end
		// Call this after finishing all tests. It prints out the totals.
        DejaGnu.done();
    }
}
