Update with current status
[gnash.git] / testsuite / misc-haxe.all / classes.all / ui / KeyLocation_as.hx
blob05863c1cda3296c3a853a9a87917945685bdfa93
1 // KeyLocation_as.hx: ActionScript 3 "KeyLocation" class, for Gnash.
2 //
3 // Generated on: 20090602 by "bnaugle". 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.
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.
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
23 // This test case must be processed by CPP before compiling to include the
24 // DejaGnu.hx header file for the testing framework support.
26 #if flash9
27 import flash.ui.KeyLocation;
28 import flash.display.MovieClip;
29 #end
30 import flash.Lib;
31 import Type;
34 // import our testing API
35 import DejaGnu;
37 // Class must be named with the _as suffix, as that's the same name as the file.
38 class KeyLocation_as {
39 static function main() {
40 #if flash9
42 // Tests to see if all the constants exist.
43 // if (KeyLocation.STANDARD != null) {
44 // DejaGnu.pass("KeyLocation.STANDARD constant exists");
45 if (Type.typeof(KeyLocation.STANDARD) == ValueType.TInt) {
46 DejaGnu.pass("KeyLocation.STANDARD is an int");
47 if (Std.string(KeyLocation.STANDARD) == "0") {
48 DejaGnu.pass("KeyLocation.STANDARD is the correct int (0)");
49 } else {
50 DejaGnu.fail("KeyLocation.STANDARD is not the correct int (Should be 0, but is "+KeyLocation.STANDARD+")");
52 } else {
53 DejaGnu.fail("KeyLocation.STANDARD is not an int. Instead, it is a "+Type.typeof(KeyLocation.STANDARD));
56 // } else {
57 // DejaGnu.fail("KeyLocation.STANDARD constant doesn't exist");
58 // }
60 // if (KeyLocation.LEFT != null) {
61 // DejaGnu.pass("KeyLocation.LEFT constant exists");
62 if (Type.typeof(KeyLocation.LEFT) == ValueType.TInt) {
63 DejaGnu.pass("KeyLocation.LEFT is an int");
64 if (Std.string(KeyLocation.LEFT) == "1") {
65 DejaGnu.pass("KeyLocation.LEFT is the correct int (1)");
66 } else {
67 DejaGnu.fail("KeyLocation.LEFT is not the correct int (Should be 1, but is "+KeyLocation.LEFT+")");
69 } else {
70 DejaGnu.fail("KeyLocation.LEFT is not an int. Instead, it is a "+Type.typeof(KeyLocation.LEFT));
72 // } else {
73 // DejaGnu.fail("KeyLocation.LEFT constant doesn't exist");
74 // }
76 // if (KeyLocation.RIGHT != null) {
77 // DejaGnu.pass("KeyLocation.RIGHT constant exists");
78 if (Type.typeof(KeyLocation.RIGHT) == ValueType.TInt) {
79 DejaGnu.pass("KeyLocation.RIGHT is an int");
80 if (Std.string(KeyLocation.RIGHT) == "2") {
81 DejaGnu.pass("KeyLocation.RIGHT is the correct int (2)");
82 } else {
83 DejaGnu.fail("KeyLocation.RIGHT is not the correct int (Should be 2, but is "+KeyLocation.RIGHT+")");
85 } else {
86 DejaGnu.fail("KeyLocation.RIGHT is not an int. Instead, it is a "+Type.typeof(KeyLocation.RIGHT));
88 // } else {
89 // DejaGnu.fail("KeyLocation.RIGHT constant doesn't exist");
90 // }
92 // if (KeyLocation.NUM_PAD != null) {
93 // DejaGnu.pass("KeyLocation.NUM_PAD constant exists");
94 if (Type.typeof(KeyLocation.NUM_PAD) == ValueType.TInt) {
95 DejaGnu.pass("KeyLocation.NUM_PAD is an int");
96 if (Std.string(KeyLocation.NUM_PAD) == "3") {
97 DejaGnu.pass("KeyLocation.NUM_PAD is the correct int (3)");
98 } else {
99 DejaGnu.fail("KeyLocation.NUM_PAD is not the correct int (Should be 3, but is "+KeyLocation.NUM_PAD+")");
101 } else {
102 DejaGnu.fail("KeyLocation.NUM_PAD is not an int. Instead, it is a "+Type.typeof(KeyLocation.NUM_PAD));
104 // } else {
105 // DejaGnu.fail("KeyLocation.NUM_PAD constant doesn't exist");
106 // }
108 // Call this after finishing all tests. It prints out the totals.
109 DejaGnu.done();
110 #else
111 DejaGnu.note("This class (KeyLocation) is only available in flash9");
112 #end
116 // local Variables:
117 // mode: C++
118 // indent-tabs-mode: t
119 // End: