1 // KeyLocation_as.hx: ActionScript 3 "KeyLocation" class, for Gnash.
3 // Generated on: 20090602 by "bnaugle". Remove this
4 // after any hand editing loosing changes.
6 // Copyright (C) 2009, 2010 Free Software Foundation, Inc.
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.
27 import flash
.ui
.KeyLocation
;
28 import flash
.display
.MovieClip
;
34 // import our testing API
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() {
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)");
50 DejaGnu
.fail("KeyLocation.STANDARD is not the correct int (Should be 0, but is "+KeyLocation
.STANDARD
+")");
53 DejaGnu
.fail("KeyLocation.STANDARD is not an int. Instead, it is a "+Type
.typeof(KeyLocation
.STANDARD
));
57 // DejaGnu.fail("KeyLocation.STANDARD constant doesn't exist");
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)");
67 DejaGnu
.fail("KeyLocation.LEFT is not the correct int (Should be 1, but is "+KeyLocation
.LEFT
+")");
70 DejaGnu
.fail("KeyLocation.LEFT is not an int. Instead, it is a "+Type
.typeof(KeyLocation
.LEFT
));
73 // DejaGnu.fail("KeyLocation.LEFT constant doesn't exist");
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)");
83 DejaGnu
.fail("KeyLocation.RIGHT is not the correct int (Should be 2, but is "+KeyLocation
.RIGHT
+")");
86 DejaGnu
.fail("KeyLocation.RIGHT is not an int. Instead, it is a "+Type
.typeof(KeyLocation
.RIGHT
));
89 // DejaGnu.fail("KeyLocation.RIGHT constant doesn't exist");
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)");
99 DejaGnu
.fail("KeyLocation.NUM_PAD is not the correct int (Should be 3, but is "+KeyLocation
.NUM_PAD
+")");
102 DejaGnu
.fail("KeyLocation.NUM_PAD is not an int. Instead, it is a "+Type
.typeof(KeyLocation
.NUM_PAD
));
105 // DejaGnu.fail("KeyLocation.NUM_PAD constant doesn't exist");
108 // Call this after finishing all tests. It prints out the totals.
111 DejaGnu
.note("This class (KeyLocation) is only available in flash9");
118 // indent-tabs-mode: t